File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sorting the Object Using TreeMap Class