0 votes
in JAVA by
Why you need to override hashcode, when you override equals in Java?

1 Answer

0 votes
by

 Because equals have code contract mandates to override equals and hashcode together .since many container class like HashMap or HashSet depends on hashcode and equals contract.

Related questions

0 votes
asked Oct 17, 2020 in JAVA by rahuljain1
0 votes
asked Jan 27, 2020 in JAVA by rahuljain1
...