Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
Hashcode
what is meant by hashcode
1 Resposta
+ 2
Ah, let me Google that for you š
'The hashCode() Method
The value returned byĀ hashCode()Ā is the object's hash code, which is the object's memory address in hexadecimal.
By definition, if two objects are equal, their hash codemust alsoĀ be equal. If you override theĀ equals()method, you change the way two objects are equated andĀ Object's implementation ofĀ hashCode()Ā is no longer valid. Therefore, if you override theĀ equals()method, you must also override theĀ hashCode()method as well.'
from https://docs.oracle.com/javase/tutorial/java/IandI/objectclass.html