aspose file tools*
The moose likes Beginning Java and the fly likes Hashmap or hashtable or ...., which one is faster for a searchable key value storage? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Hashmap or hashtable or ...., which one is faster for a searchable key value storage?" Watch "Hashmap or hashtable or ...., which one is faster for a searchable key value storage?" New topic
Author

Hashmap or hashtable or ...., which one is faster for a searchable key value storage?

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 551
Hi
Thank you for reading my post
looking at
http://www.coderanch.com/t/233717/threads/java/Hashtable-or-HashMap

http://forum.java.sun.com/thread.jspa?threadID=487732&messageID=2285137

and

http://www.artima.com/forums/flat.jsp?forum=1&thread=78029

I am confused and i can not understand whether hashmap is faster or hashtable.

my requirement is to store a pair of key,value and be able to search based on key.

now, which collection class i should choose?

Thanks
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Originally posted by raminaa niilian:
which collection class i should choose?


Hashtable should never be used in new code except if you have to work with an older API that wants a Hashtable as a method argument. Otherwise, use HashMap, always.


[Jess in Action][AskingGoodQuestions]
 
jQuery in Action, 2nd edition
 
subject: Hashmap or hashtable or ...., which one is faster for a searchable key value storage?