wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes HashMap Vs Hash table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "HashMap Vs Hash table" Watch "HashMap Vs Hash table" New topic
Author

HashMap Vs Hash table

Ginu Jacob
Greenhorn

Joined: Jun 19, 2005
Posts: 16
Hi,

Can anyone tell me the difference between hash map and hash table?

I know that hash table does not allow any null values whereas Hash map does.
Any other differences?

regards,
Ginu Jacob
Nibin Jacob Panicker
Greenhorn

Joined: Aug 16, 2005
Posts: 22
The main diffrence btw HashTable and HashMap is that HashTable methods are Threads-Safe(meaning they are synchronised methods) while HashMap is not ThreadSafe..So basically HashTable is used when more than one thread will be accessing it..
Kudret Serin
Ranch Hand

Joined: Aug 02, 2005
Posts: 167

Hi
HashMap can store one null key and multiple null values but HashTable can not have any null.
HashTable is synchronized but HashMap is NOT.
Cheers
Ginu Jacob
Greenhorn

Joined: Jun 19, 2005
Posts: 16
If u have any sample code for the same,please post it..

regards,
ginu
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HashMap Vs Hash table