Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how the key-value pair is sorted in ascending and descending order.

 
krishnan gowri
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I WAS to store my key-value pairs in a map. USING ONLY ONE BUTTON FIRST TIME I CLICK THE BUTTON MEAN THE RESULT IS IN ASCENDING ORDER AGAIN SECOND TIME I CLICK THE SAME BUTTON THE RESULE IS IN DESCENDING ORDER.

here ascending order we are use SortedMap interface class TreeMap. then descending order which class or method we use.

post answer.

thank you.
 
Gavin Tranter
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would check the TreeMap API

G
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, krishnan!

The API documentation of the TreeMap class is available at http://java.sun.com/j2se/1.5.0/docs/api/java/util/TreeMap.html.

After reviewing it, as Gavin recommended, do you have any ideas for implementing the descending order functionality? If you're still totally stuck, I'm sure some friendly JavaRanchers would be glad to help nudge you further towards a solution.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic