Getting the difference between two sets

The Solution to Getting the difference between two sets is


Try this

test2.removeAll(test1);

Set#removeAll

Removes from this set all of its elements that are contained in the specified collection (optional operation). If the specified collection is also a set, this operation effectively modifies this set so that its value is the asymmetric set difference of the two sets.

~ Answered on 2013-09-05 19:42:42


Most Viewed Questions: