Posted By:
amitg
Posted On:
Monday, August 6, 2012 10:22 AM
Hi Narsinmha ,
The basic characteristic of set is to allow only unique values in collection and Set make sure that using the equals method of the elements being added. So let say if you are adding Person object and if you implement proper equals and hashcode methods then Set will make use of this equals and hashcode methods to make sure that elements are unique.
Ans to Q 2: Just copy all your element in Set to remove duplicates