本文共 569 字,大约阅读时间需要 1 分钟。
package test_class;import java.util.ArrayList;import java.util.List;public class test_interface { public static void main(String[] args) { Lista=new ArrayList<>(); List b=test_arr(a); for (int i = 0; i < b.size(); i++) { System.out.println(b.get(i)); } } public static List test_arr(List list1){//如果不用static 在主函数中便不能使用该方法 list1.add("AAA"); list1.add("BBB"); list1.add("CCC"); return list1; }}
转载地址:http://uamen.baihongyu.com/