46.7k views
5 votes
If class Dog has a derived class Retriever, which of the following is true?

a. In the case of single inheritance, Dog can have no other derived classes.
b. In the case of single inheritance, Retriever is derived from no other class except Dog.
c. The relationship between these classes implies that Dog “is a” Retriever.
d. The relationship between these classes implies that Retriever “has-a” Dog.

1 Answer

6 votes

Answer: The answer is option b.

Step-by-step explanation:

Refer the attached image for the better explanation.Since retriever is derived from Dog class if it is single inheritance it is true that Retriever cannot be derived from other class.

Dog can have other derived classes in other single inheritances.

The relationship from this inheritance is that every "Retriever is a Dog" .

If class Dog has a derived class Retriever, which of the following is true? a. In-example-1
User Alxwrd
by
6.1k points