This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes Hashset, Hashmap, Hashtable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Hashset, Hashmap, Hashtable" Watch "Hashset, Hashmap, Hashtable" New topic
Author

Hashset, Hashmap, Hashtable

pravin suroshe
Greenhorn

Joined: Jan 13, 2005
Posts: 8
Hi all,

What is the difference between Hashset, Hashmap, Hashtable?

Thanx in advance.
Steven Bell
Ranch Hand

Joined: Dec 29, 2004
Posts: 1071
From the javadoc of HashMap:

(The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls.)

As for the HashSet, it is a class that uses hash values to store objects, but obeys the Set contract to not allow duplicate objects.
 
Consider Paul's rocket mass heater.
 
subject: Hashset, Hashmap, Hashtable