This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
raminaa niilian
Ranch Hand
Posts: 551
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic