, hashCode() , API hashmap.
API , , .
hashCode() , , , - .
, , .
, .
To get values ββfrom the data structure in the entire program, you will need to save links to all keys that you previously inserted (using a different data structure). You cannot use keys that are βsimilarβ in terms of the state of the object.
Person steve1 = new Person("Steve","21","engineer");
Person steve2 = new Person("Steve","21","engineer");
map.put(steve1,"great worker");
map.get(steve2);
map.get(steve1);
source
share