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
A superclass, also known as a parent class or base class, is a class that is extended by another class (subclass). It provides common attributes and behaviors that can be inherited by its subclasses.
A subclass is a class that extends another class (superclass). It inherits all the attributes and behaviors from its superclass while adding its own additional features.
Inheritance is the mechanism in Java where one class acquires properties (fields and methods) from another class. It allows code reuse and promotes hierarchical organization of classes.
Method Overriding: Method overriding occurs when a subclass provides its own implementation of a method that already exists in its superclass. The overridden method in the subclass replaces the original implementation provided by the superclass.