Next: Marking methods and classes
Up: Extending Classes
Previous: Constructors in extended classes
Contents
Subsections
Overloading - providing more than one method with the same name but with different signatures.
Overriding - replacing a superclass's implementation with your own.
Signatures must be identical.
Return type must be the same.
Only accessible non-static methods can be overridden.
A subclass can determine whether a parameter in an overridden method is final.
Available in all non-static methods of a class.
super.method() - uses the superclass's implementation of
method .
Next: Marking methods and classes
Up: Extending Classes
Previous: Constructors in extended classes
Contents