Fiveable
Fiveable

extends

Definition

In Java, the keyword "extends" is used to create a subclass that inherits properties and methods from a superclass. It establishes an "is-a" relationship between classes.

Analogy

Think of a superhero and their sidekick. The sidekick extends the abilities and powers of the superhero, inheriting their skills and knowledge.

Related terms

Subclass: A class that extends another class to inherit its properties and methods.

Superclass: The class that is being extended or inherited from.

Inheritance: The process by which one class acquires the properties and behaviors of another class.

"extends" appears in:

Practice Questions (20)



© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.


© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.