Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Java in General and the fly likes HashSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "HashSet" Watch "HashSet" New topic
Author

HashSet

Seth Anshul
Greenhorn

Joined: May 02, 2006
Posts: 16
Is there a way for a HashSet to have duplicate values?
Amit Y Desai
Ranch Hand

Joined: Dec 06, 2007
Posts: 35
Hash set is meant for having non-duplicate values.
If you want duplicate values then go for other collection interfaces.
 
jQuery in Action, 2nd edition
 
subject: HashSet
 
Similar Threads
Iterator better for that?
How to remove dublicate elements from List
Hashmap
Question About TreeSet?
add values to a set and remove