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 A code to print the keys from two different hashMap having same values Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "A code to print the keys from two different hashMap having same values" Watch "A code to print the keys from two different hashMap having same values" New topic
Author

A code to print the keys from two different hashMap having same values

sinchan banerje
Greenhorn

Joined: Dec 14, 2011
Posts: 7


Here a is HashMap1 and b is HashMap2 , the elements displaced are keys of common values depending upon the input given...
Nitin Surana
Ranch Hand

Joined: Jan 21, 2011
Posts: 129

I guess you are trying to put the common values from 2 maps into another map. Is that what you are trying to do?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32675
    
    4
Welcome to the Ranch
As you have already been told you can use a second map. You can use the values in the first map as keys in the second map, and lists of the keys in the first map as values in the second map.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: A code to print the keys from two different hashMap having same values
 
Similar Threads
Parsing a hashtable
how to iterate a hashmap with key hashmap
HashMap<Integer, ArrayList>
Generic Collections
re: Iteration in a Map