aspose file tools*
The moose likes Java in General and the fly likes Reason for Values override in hashmap................. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Reason for Values override in hashmap................." Watch "Reason for Values override in hashmap................." New topic
Author

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

Mani Raju
Ranch Hand

Joined: Oct 09, 2012
Posts: 46
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

Joined: Apr 06, 2010
Posts: 4388
    
    8

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

Joined: Oct 09, 2012
Posts: 46
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
 
subject: Reason for Values override in hashmap.................