File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes hashMap vs treemap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "hashMap vs treemap" Watch "hashMap vs treemap" New topic
Author

hashMap vs treemap

Laura Williamson
Ranch Hand

Joined: Apr 28, 2004
Posts: 44
I need to store records + their lockCookies in a map.

treemap is ordered, so maybe use this one?

any opinions on best one to use?
Hanna Habashy
Ranch Hand

Joined: Aug 20, 2003
Posts: 532
hi Laura:
Tree map is ordered, hence it is slowere than hash map. use tree map only if you need the order feature.


SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
 
wood burning stoves
 
subject: hashMap vs treemap
 
Similar Threads
Reg., Hashtable
Collections
Internationalization of TreeMap
reading the elements in HashMap
Sorted map -- can't get there from here?