How to remove the elements of array list 1 which are avaliable from array list 2?
for example
ArrayList<AClass> list1 = new ArrayList<AClass>(); //AClass(int IDNumber, String date)
ArrayList<Integer> list2 = new ArrayList<Integer>();
AClass a1 = new AClass(1, "20/01/2013");
AClass a2 = new AClass(2, "21/01/2013");
AClass a3 = new AClass(3, "22/01/2013");
AClass a4 = new AClass(4, "23/01/2013");
list1.add(a1);
list1.add(a2);
list1.add(a3);
list1.add(a4);
list2.add(2);
list2.add(4);
//remove 2 and 4 from list1,
the size of the lists will be big, is there any methods or algorithms to remove them.
Im expecting answer as
// after removing Im expecting answer from list1 as
[1,22/01/2013]
[3,22/01/2013]