wood burning stoves 2.0*
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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