File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Without Key can we retrieve particular value 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 "Without Key can we retrieve particular value in hashmap" Watch "Without Key can we retrieve particular value in hashmap" New topic
Author

Without Key can we retrieve particular value in hashmap

Rajendra Prakash
Ranch Hand

Joined: Sep 10, 2009
Posts: 293
Without knowing key can we retrieve particular value in hashmap. Is it possible or not
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
Check out the Map.entrySet() and Map.values() methods; those provide access to all values without having to provide a key.
Rajendra Prakash
Ranch Hand

Joined: Sep 10, 2009
Posts: 293
i know how to get all values. so no way to retrieve particular value without knowing the key.
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
What makes a value "particular" if not the key?
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

If you know the value you want, and you can get all values, then you can get all values and iterate until you get the particular value you want.


Steve
 
 
subject: Without Key can we retrieve particular value in hashmap