Hashcode | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Hashcode

what is meant by hashcode

5th Feb 2017, 1:30 PM
radhakrishna
radhakrishna - avatar
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
5th Feb 2017, 5:10 PM
Tashi N
Tashi N - avatar