This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Mani Raju
Ranch Hand
Posts: 46
  • 0
  • 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: 4549
8
Java Netbeans IDE Scala
  • 0
  • 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
  • 0
  • 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...........

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic