Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reason for Values override in hashmap.................

 
Mani Raju
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, i get values from xml document and i tried to store in hashmap. but problem is last stored values only available in hashmap but it does not contain all stored values. It contains only last stored values.
i mean, suppose we stored values like <key, Value>, <"1","one">,<"2","two">, <"3", "three">......
but, i tried to get all values from that hashmap, it returns only one value. i.e., last value <"3","three">. All values overridden.

Previously stored values are overridden.

Can any one help me to solve this issue..................

 
Matthew Brown
Bartender
Posts: 4567
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We'd need to know how you're storing them, and possibly how you're extracting them. A HashMap definitely can store multiple pairs, so you must be doing something wrong, but we've got no way of guessing what.
 
Mani Raju
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matthew Brown wrote:We'd need to know how you're storing them, and possibly how you're extracting them. A HashMap definitely can store multiple pairs, so you must be doing something wrong, but we've got no way of guessing what.



Thanks, i found the reason. Reason is "I stored the multiple values with same key again and again. Because of that reason only i am getting issue...........

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic