• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A set, by definition, holds no duplicate elements (we don't say keys).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic