Can I have a set containing identical elements?

Posted by Roman on Stack Overflow See other posts from Stack Overflow or by Roman
Published on 2010-03-28T13:23:04Z Indexed on 2010/03/28 13:33 UTC
Read the original article Hit count: 170

Filed under:
|
|
|

It is convenient for me to use a set. I like how I can "add" ("remove") an element to (from) the set. It is also convenient to check if a given element is in the set.

The only problem, I found out that I cannot add a new element to a set if the set has already such an element. Is it possible to have "sets" which can contain several identical elements.

© Stack Overflow or respective owner

Related posts about java

Related posts about sets