How IdentityHashMap v get(key) methods woks in these below situation :     import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.Map;


public class IdentityHashMapExample {
    public static void main(String args[]){
            
    // Created HashMap and IdentityHashMap objects


     Map hashmapObject = new HashMap();

     Map identityObject = new IdentityHashMap();

        

       

   // Putting  keys and values in HashMap and IdentityHashMap Object


        hashmapObject.put(new String("key") ,"Google"); 

        hashmapObject.put(new String("key") ,"Facebook"); 

       

        identityObject.put(new String("identityKey") ,"Google"); 

  identityObject.put(new String("identityKey") ,"Facebook"); 
 // Print HashMap and IdentityHashMap Size : After adding  keys

       
   System.out.println("HashMap after adding key :"+ hashmapObject);
  System.out.println("Getting value from HashMap :"+ hashmapObject.get("key"));
        

 System.out.println("IdentityHashMap after adding key :"+ identityObject);
 // why get(key) method return the null value in case of identityHash Map 
 System.out.println("Getting value from IdentityHashMap :"+ identityObject.get("identityKey"));
}
}