0
Could someone please explain what is being overridden in the extended superclass "Animal"... when commented out, value remains.
3 Respuestas
+ 3
which is why I think this is a poor example of how to explain inheritance.The animal class contains one method "make sound" soo when the cat class overrides that method commenting the extends has the same results.
+ 1
Going forward, things seem like they will make more sense later, "Every Animal makes a sound, but each has a different way to do it. That's why we define an abstract class Animal, and leave the implementation of how they make sounds to the subclasses.
This is used when there is no meaningful definition for the method in the superclass."
0
Correct. I dont see why calling in a method to change it's value makes since unless the goal is to grab the superclass variables then rename to current current class, if I am understanding correctly. Thanks for the clarity. Good to know I'm not loosing my mind.