Question DSA-HASH-0017
HardWhy does a HashMap key class in Java need consistent equals() and hashCode() methods?
- A.
hashCode() is never used
- B.
Equal objects must have equal hash codes, or lookups may search the wrong bucket
- C.
Sign up free to see the answer and a step-by-step explanation.