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

Hashtable methods

 
sumit Sanghai
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We know that Hashtable is synchronized. But not all the Hashtable methods are synchronized. Why?
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
because they don't access shared data.
There's seldom a good reason to use a Hashtable anyway.
 
sander hautvast
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's seldom a good reason to use a Hashtable anyway.

why is that?
 
Sudhakar Namasivayam
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls.

http://java.sun.com/j2se/1.4.2/docs/api/java/util/HashMap.html

http://www.coderanch.com/t/231485/threads/java/Hashtable-vs-HashMap
 
Zhongbo Li
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
用打包的办法
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic