This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Sorting the Object Using TreeMap Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Sorting the Object Using TreeMap Class" Watch "Sorting the Object Using TreeMap Class" New topic
Author

Sorting the Object Using TreeMap Class

rex tony
Ranch Hand

Joined: Aug 29, 2007
Posts: 159
Sorting the Object Using TreeMap Class
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
I closed your other three posts with similar text:

Sorting the Object Using HashTable Class
Sorting the Object Using HashSet Class
Sorting the Object Using HashMap Class

None of these classes has anything at all to do with sorting. There is no point to discussing these topics separately. If you need to sort objects, put them in some other collection. Like say, a TreeSet. Or possibly a TreeMap if you actually need a Map as well as sorting.

Which brings us to this post. Put your objects into the TreeSet, or TreeMap. Now, they're sorted. You're done. Wasn't that easy?

Last (maybe it should have been first), this post isn't even a question. Please put some effort into telling us what you want to know, and what you already know about it. See How to Ask Questions on JavaRanch for more discussion of this.


"I'm not back." - Bill Harding, Twister
 
Consider Paul's rocket mass heater.
 
subject: Sorting the Object Using TreeMap Class