Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HashMap  RSS feed

 
Anthony Smith
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been working with HashMaps in my code, and now I need something sortable... I would use an ArrayList, but I want to keep the key/value pair relationship... What are my options?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.util.TreeMap, or more generally, anything that implements java.util.SortedSet .
 
Hentay Duke
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have look at TreeMap, might be what you want.

Whoops Ernest beat me to the punch.
[ May 09, 2005: Message edited by: Hentay Duke ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!