File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 550
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: 24166
    
  30

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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hashmap or hashtable or ...., which one is faster for a searchable key value storage?
 
Similar Threads
The use of TreeMap
Hide Source Code in Struts
calculate duration between two dates
Getting error while compiling
Displaying Binary Data Fetched with AJAX