0
What does the auto-generated hashcodes and equals algorithms exactly do, and why?
For example, why hashcode override contains prime and result variables and their product is added to the name.hashcode() ? What does " class other = (class) obj " statement mean and why it has been integrated in equals() override? Where can we find a step by step explanations of those methods algorithms?
1 ответ
0
As far as I know the auto-generated hashCode() method returns the adress of that object in your computer memory. The basic equals() method compares those adresses.