aspose 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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
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: 39834
    
  28
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: A code to print the keys from two different hashMap having same values