Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hashset, Hashmap, Hashtable

 
pravin suroshe
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

What is the difference between Hashset, Hashmap, Hashtable?

Thanx in advance.
 
Steven Bell
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic