Polymorphism

If the derived class has a method or data element with the same name as the base class, the thing in the derived class takes precedence. This is a very important feature of Java and object oriented programming. If you need to access the version of the method that is part of the parent, you can use the super reference. It is possible to prevent child classes from overriding a method. If it is marked final, then the children must use the parent method.

One of the issues when using inheritance is what happens when you use a reference of the type of a class higher up the tree to hold an object of a class lower in the tree? If you use such a reference to access the methods on the class, do you get the parents version or the child version. The simple answer is you get the version of whatever the reference is pointing to.

For more notes, see this page.