Overriding Methods

Caleb Thomas
3 min read
Listen to this study note
Study Guide Overview
This study guide covers subclass methods, including inheritance of public methods. It focuses on method overriding and overloading, explaining their differences and implementation. The guide uses a Rectangle class example to demonstrate method overriding with the @Override
annotation and discusses adding new instance variables and methods in subclasses.
Now that we know how to make subclasses and their constructors, it is time to write their methods. A subclass will inherit all public methods from the superclass. These methods will remain public in the subclass. Most methods that are inherited from the superclass do not need to be rewritten.
Any method that we call on an object must be defined within the class associated with that object or within th...

How are we doing?
Give us your feedback and let us know how we can improve