1.

What is the premise of equality for IdentityHashMap?(a) Reference equality(b) Name equality(c) Hashcode equality(d) Length equality

Answer» Right option is (a) Reference equality

The explanation is: IdentityHashMap is rarely used as it violates the basic contract of implementing equals() and hashcode() method.


Discussion

No Comment Found

Related InterviewSolutions