Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sorting the Object Using TreeMap Class

 
rex tony
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorting the Object Using TreeMap Class
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic