This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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 REST with Spring (video course) this week in the Spring 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
    subject: Sorting keys automatically
    It's not a secret anymore!