This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design 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
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: hashMap vs treemap
 
It's not a secret anymore!