This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes HashTable and HashMap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "HashTable and HashMap " Watch "HashTable and HashMap " New topic
Author

HashTable and HashMap

Venu Navat
Ranch Hand

Joined: Dec 28, 2004
Posts: 30
what is difference between HashTable and HashMap ???


-Venu Navat
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
HashMap is a newer class, part of the Collections framework. I would prefer it in almost all cases. Hashtable is "synchronized" but not in a way that makes me warm and fuzzy in complex multithreaded apps. I'd be more inclined to synchronize access to a private HashMap on my own or use the Collections class to generate a synchronized HashMap.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Take a look at the Java API docs for the version of Java you are using. It will explain some of the differences between these two classes.

Layne


Java API Documentation
The Java Tutorial
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HashTable and HashMap
 
Similar Threads
Hashtables are synchronized...
Hashtable vs HashMap
HashMap vs. Hashtable
Can't develop logic
HashMap or HashTable