This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes How Do I Know There is No Duplicate Keys in a Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How Do I Know There is No Duplicate Keys in a "set" - a Java Collections" Watch "How Do I Know There is No Duplicate Keys in a "set" - a Java Collections" New topic
Author

How Do I Know There is No Duplicate Keys in a "set" - a Java Collections

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
This question is about "set" under the Java Collections.

If a "set" is given to me, how do I get to know there is no duplicate keys in that "set"? Thank you.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

A set, by definition, holds no duplicate elements (we don't say keys).


[My Blog]
All roads lead to JavaRanch
 
wood burning stoves
 
subject: How Do I Know There is No Duplicate Keys in a "set" - a Java Collections
 
Similar Threads
How Do We Know that We Add Duplicate to a Set and Add Duplicate Key to a Map
problems about Collections
Any Link Between ArrayList and HashMap
Collections
How to index java objects in memory