File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sorting keys automatically

 
thomas davis
Ranch Hand
Posts: 207
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which collection interface does Sort the keys automatically ?
1.MAP
2.SET
3.TreeMap
4.SortedSet
 
Steve Lovelace
Ranch Hand
Posts: 125
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
  • 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 ]
     
    Stan James
    (instanceof Sidekick)
    Ranch Hand
    Posts: 8791
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    See if this collections crib sheet helps. It's really brief, but should point you to some interesting places in the JDK docs.
     
    Don't get me started about those stupid light bulbs.
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic