Retains only the elements in this set that are contained in the specified collection (optional operation). In other words, removes from this set all of its elements that are not contained in the specified collection. If the specified collection is also a set, this operation effectively modifies this set so that its value is the intersection of the two sets.
Originally posted by Ais Kaly: I have 3 lists of objects,
for example: lets take numbers
A->[1, 2, 3, 4, 5]
B->[1, 3, 5]
C->[1, 2, 3, 4]
I want the D list to have only the common elements in all 3 of them that is,
incase if any one of the list has no element -> compare the other two only and if any two are blank list, fetch the other entire full list as D
what is the best way to do this in java.
[ April 24, 2007: Message edited by: Ais Kaly ]
[ April 24, 2007: Message edited by: Stephen Paulsen ]