IdentityHashMap extends AbstractMap and implements the Map interface. It uses reference equality (==) instead of object equality (equals()) when comparing keys and values. IdentityHashMap obtains hash codes via System's static int identityHashCode(Object x) method instead of via each key's hashCode() method. The hash code for the null reference is zero. IdentityHashMap is a generic class that has this declaration: class IdentityHashMap K specifies the type of key V specifies the type of value.
import java.util.IdentityHashMap; import java.util.Map; public class Main { public static void main(String[] argv) throws Exception { Map