In the loop there is if clause. It checks whether or not Object was added to
unique set. if it is already there the Object is being added to dups set.
Therefore all objects that have several copies are gathered to dups set.
Than those are removed from unique set. Finally we have two separate sets
o
On Dec 18, 1:44 pm, DHARMENDRAN GOVIND wrote:
> Hello,
>
> The below program has declared 2 variables of type Hashset and one of the
> statements is trying to load duplicate names into variable dup.
>
> Question: Doesn't add method of Set interface follow "no duplicate rule"?
> Then what is the