Equal method and hashcode | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

Equal method and hashcode

if we override equal method and hashcode,which method will run first and why?

2nd Nov 2017, 9:00 AM
oyl
1 Réponse
+ 1
Has nothing to do with "running". The only rule is that if equals returns true the hashcodes should be equal as well.
2nd Nov 2017, 9:30 PM
1of3
1of3 - avatar