File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Sorting keys automatically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Sorting keys automatically" Watch "Sorting keys automatically" New topic

Sorting keys automatically

thomas davis
Ranch Hand

Joined: Feb 01, 2003
Posts: 207
Which collection interface does Sort the keys automatically ?
Steve Lovelace
Ranch Hand

Joined: Sep 03, 2003
Posts: 125
  • MAP - you must mean Map: keys but no sorting
  • SET - you must mean Set: no keys and no sorting
  • TreeMap - keys and sorting, but this is not an interface - it is a concrete class
  • SortedSet: sorting but no keys

  • [ September 30, 2003: Message edited by: Steve Lovelace ]

    The Inner that is named is not the true Inner.
    Stan James
    (instanceof Sidekick)
    Ranch Hand

    Joined: Jan 29, 2003
    Posts: 8791
    See if this collections crib sheet helps. It's really brief, but should point you to some interesting places in the JDK docs.

    A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
    I agree. Here's the link:
    subject: Sorting keys automatically
    It's not a secret anymore!