偶然看见这段代码,但是都不咋懂,能不能请教一下.....
int[] a = {1,5,4,6};
int[] b = {1,5,4,6,8,7,2};
List result_insect = intersect(arr a, arr b);
System.out.println("求交集的结果如下:");
for (Object str : result_insect) {
System.out.println(str);
intersect(arr a, arr b) 求交集 返回的是list'集合 List result_insect = 给这个list集合命名
for (Object str : result_insect) {
System.out.println(str);
增强for 遍历这个list集合并打印