?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Easy

Carrots and Vegetables Class Relationships

APCSA-KEDGNT

A Vegetable takes on many of the characteristics and functionality of a Food and a Carrot takes on many of the characteristics and functionality of a Vegetable. Vegetable, Food, and Carrot are all classes that we define and Vegetable extends Food and Carrot extends Vegetable.

What concept does this relationship describe?

A

Inheritance.

B

Polymorphism.

C

Situational extension.

D

Data abstraction.

E

Procedural abstraction.