Vani wrote:
I want to retreive all the objects present in
list2 which is present in list1 also and remove them from list2.
how do i use boolean contains(object o) in this case ?
Not at all.
Better use bulk operations:
List retrieve= new ArrayList(list2);
retrieve.retainAll(list1);
list2.removeAll(list1);
Yours,
Bu.