File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "hashMap vs treemap" Watch "hashMap vs treemap" New topic

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
I agree. Here's the link:
subject: hashMap vs treemap
It's not a secret anymore!