April 2017
Beginner
504 pages
14h 11m
English
IdentityHashMap is a special Map that implements the Map interface literally, but as a matter of fact, it violates the contract the Map interface documentation defines. It does it with good reason. The implementation uses a hash table just as HashMap, but to decide the equality of the key found in the bucket comparing with the key element provided as argument to the get method it uses Object reference (== operator) and not the method equals, which is required by documentation of Map interface.
Read now
Unlock full access