public class Test1 {
public static void main(String[] args) {
List list1 = new ArrayList();
Random random = new Random();
for(int i=1;i<1000;i++){
list1.add(random.nextInt(i)*10);
}
List list2 = new ArrayList();
for(int i=1;i<10000;i++){
list2.add(random.nextInt(i)*100);
}
System.out.println("list1的大小: "+list2.size());
List temp = new ArrayList(list1);
System.out.println(temp);
temp.retainAll(list2);
System.out.println(temp);
list1.removeAll(temp);
list2.removeAll(temp);
List list3 = new ArrayList();
list3.addAll(list1);
list3.addAll(list2);
System.out.println(list3.size());
}
}