Hashcode | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Hashcode

what is meant by hashcode

5th Feb 2017, 1:30 PM
radhakrishna
radhakrishna - avatar
1 Answer
+ 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