Ordinary Maps use the following test for equality (k1==null ? k2==null : k1.equals(k2)).) IdentityHashMap uses k1==k2. My question is that even Object's equals() method returns k1==k2. Only when the Object's equals method is overridden inside a class, does it perform content based equality comparison. So, IdentityHashMap could have used Object's equals method for doing this. Is it right ? (It probably doesn't because it extends AbstractMap which already defines equals to perform content based comparison, not reference based.)
daudiam -6 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.