0
Java question
this code came out in one of the java lesson and it is so hard to understand.can someone explain briefly what is this code about.what is that hashcode() thing? https://code.sololearn.com/cvT28M3GJky1/?ref=app
1 Answer
0
a hashcode is used to identify objects. If they have the same hashcode they are the same object. This code simply overrides the hashcode method and the equals method (which uses the hashcode) to check equality of the Animal class.