Written by the Fiveable Content Team โข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโขWritten by the Fiveable Content Team โข Last updated September 2025
Definition
The "extends" keyword is used in object-oriented programming to establish an inheritance relationship between classes. It allows a subclass to inherit properties and behaviors from a superclass.
A subclass is a class that inherits properties and behaviors from another class called its superclass. The "extends" keyword establishes this relationship between classes.
A superclass is a class that serves as the base or parent class for other classes. It provides common attributes and behaviors that can be inherited by its subclasses.
Inheritance hierarchy refers to the hierarchical structure formed by classes through inheritance relationships. The "extends" keyword helps define this hierarchy by establishing relationships between superclasses and subclasses.