This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Ordered Collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Ordered Collection" Watch "Ordered Collection" New topic

Ordered Collection

surendar prabu
Ranch Hand

Joined: Jul 24, 2006
Posts: 102
I need to maintain key-value pairs. I need to stre them in an ordered manner.say if i insert the elements as


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?

Surendar prabu
[ August 01, 2007: Message edited by: surendar prabu ]

SCJP 1.4
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Check out the JavaDoc for LinkedHashMap.

Consultant, Sima Solutions
surendar prabu
Ranch Hand

Joined: Jul 24, 2006
Posts: 102
Thanks Merill. I have got what i needed.
GeeCON Prague 2014
subject: Ordered Collection