File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes How to store Duplicate Element in HashSet Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "How to store Duplicate Element in HashSet" Watch "How to store Duplicate Element in HashSet" New topic
Author

How to store Duplicate Element in HashSet

amir thakur
Greenhorn

Joined: Jul 09, 2009
Posts: 11
Heloo....

May any one tell me how to store duplicate values in HashSet...
but what i know is that HashSet does not allow duplicate values....

so please tell me how to store duplicate values in HashSet....


Thanks In Advance......
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56150
    
  13

Please take the time to choose the correct forum for your posts. This forum is for questions on HTML.

For more information, please read this.

This post has been moved to a more appropriate forum.

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56150
    
  13

You use a different collection. The whole point of a Set is to not allow duplicate entries.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19214

Use a List implementation like ArrayList instead.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://jrebel.com/download
 
subject: How to store Duplicate Element in HashSet
 
Similar Threads
How to use ListSelectionListener in Jtable?
HashSet
How to use ListSelectionListener in Jtable?
Hashset, Hashmap, Hashtable
How to check duplicates in hashmap