日期:2014-05-20 浏览次数:20706 次
public static void removeArrayDemo() {
int a[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
int b[] = { 3, 5, 1 };
List<Integer> aList = new ArrayList<Integer>();
List<Integer> bList = new ArrayList<Integer>();
for (int i : a) {
aList.add(i);
}
for (int i : b) {
bList.add(i);
}
aList.removeAll(bList);
System.out.println(aList);
}