I have a class Dog extends Animal.
Then I call the hashCode() method as follows.
Animal animal = new Dog(200);
System.out.println(animal.hashCode());
Here,
If I've overridden the hashCode() in the Dog class it will be returned.
Else if I've overridden the hashCode() in the Dog class it will be returned.
Else some integer returned.
I wanna know...
Why does it call the hashCode() of the super class when it is not overriden in the Dog class? How and what the 'some integer' generated
When the hashCode is not generated in anywhere. (I have heard that it is the memory location of the object but not sure.)