Re: collections set &list interfaces
Tuesday, December 17, 2013 08:43 PM
Set is the child element of collection
if we want a group of individual element in a single unit and duplecate are not allow and insertion order not preserve then we should go for Set interface.
because equal method is check. weather the element is duplicate or not . if it is duplicate it will return false.
List lst = new List();
HashSet hs = new HashSet(lst);
output [12, 23];