0 votes
in JAVA by
Is it possible for two unequal objects to have the same hashcode?

1 Answer

0 votes
by

Yes, two unequal objects can have same hashcode that's why collision happen in a hashmap.

the equal hashcode contract only says that two equal objects must have the same hashcode it doesn't say anything about the unequal object.

Related questions

0 votes
asked Jan 27, 2020 in JAVA by rahuljain1
0 votes
asked Oct 9, 2023 in Service Now by john ganales
...