Please enable JavaScript to use CodeHS

Chapter 9

Inheritance

9.3 Overriding Methods

How to Override a Method

Class Hierarchy Considerations

Calling Override Methods

Square is a Rectangle

Student toString

Restaurant Bills

Check Your Understanding

  1. Incorrect Correct No Answer was selected Invalid Answer

Exercise: Dogs Bark

Vocabulary

Term Definition
Override Override a method occurs when a subclass has the same method signature as a superclass. When a method is overridden, Java uses the method from the subclass.,
@Override Java key term used to denote the user intendeds to override a method.