Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ordered Collection

 
surendar prabu
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to maintain key-value pairs. I need to stre them in an ordered manner.say if i insert the elements as

b,B
c,C
a,A
d,D

I want to retrieve them in the same order as inserted. Also i dont want them to be sorted. I need only ordered key value pairs.
How can i achieve this?

regards,
Surendar prabu
[ August 01, 2007: Message edited by: surendar prabu ]
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the JavaDoc for LinkedHashMap.
 
surendar prabu
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Merill. I have got what i needed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic