Which three are true?

Given:

Which three are true?

Given:

Which three are true?

A.
BasicCar uses composition.

B.
SuperCar uses composition.

C.
BasicCar is-a Car.

D.
SuperCar is-a Car.

E.
SuperCar takes advantage of polymorphism

F.
BasicCar has-a Car

Explanation:

B: The relationship modeled by composition is often referred to as the “has-a” relationship. Here
SuperCarhas-a Car.
C:The relationship modeled by inheritance is often referred to as the “is-a” relationship. Modeling
an is-arelationship is called inheritance because the subclass inherits the interface and, by default,
theimplementation of the superclass. Inheritance of interface guarantees that a subclass can
accept all the samemessages as its superclass. A subclass object can, in fact, be used anywhere
a superclass object is called for.E:The polymorphic method call allows one type to express its
distinction from another, similar type, as long asthey’re both derived from the same base type.
This distinction is expressed through differences in behavior ofthe methods that you can call
through the base class.



Leave a Reply 1

Your email address will not be published. Required fields are marked *