skip to main | skip to sidebar

Java Programs and Examples with Output

Pages

▼
 
  • RSS
  • Twitter
Tuesday, October 30, 2012

Efficient retrieval of Keys using given Values in the Map

Posted by Raju Gupta at 2:30 PM – 0 comments
 
This asset provides a reusable code which can be used to retrieve the Keys when Values are given in Java maps.

BidiMap bidimap = new DualHashBidiMap();

bidimap.putAll(theMap);  
  
String myKey= bidimap.inverseBidiMap().get("Mumbai").toString();

System.out.println("The Key is :"  +  myKey) ;

Leave a Reply

Newer Post Older Post
Subscribe to: Post Comments ( Atom )
  • Popular
  • Recent
  • Archives
Powered by Blogger.
 
 
 
© 2011 Java Programs and Examples with Output | Designs by Web2feel & Fab Themes

Bloggerized by DheTemplate.com - Main Blogger