Asked by

Logan Tankersley
on Oct 26, 2024

verifed

Verified

If Shape is a class and you create a new class Rectangle that extends Shape, then Shape is a(n) ____ and Rectangle is a(n) ____.Which word goes in the second blank of the sentence above?

A) subclass
B) superclass
C) method
D) package

Superclass

In object-oriented programming, a superclass is a class from which other classes inherit methods and properties.

Subclass

A subclass is a class that inherits from another class, known as a superclass, enabling code reuse and the creation of more specific categories or behaviors.

  • Distinguish between superclass and subclass in inheritance hierarchies.
verifed

Verified Answer

JS
Jhyazecha SmithOct 31, 2024
Final Answer:
Get Full Answer