, ( ) Object. , equals(Object) hashcode() , . , equals(Object) HashMap / .
However, if you really need to use Object as a key type, IdentityHashMap might be a better option. For starters, it does not use equals(Object)or hashcode(), but uses the values ==and hash values of the identifiers of key objects.
source
share