Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Iteration of a HashMap in the order of insertion

 
Gaurav Kshatriya
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I want to know how we can iterate a Hashmap in the same order in which we inserted the key value pairs.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a LinkedHashMap.
 
Gaurav Kshatriya
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Christophe
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic