171k views
1 vote
How does the "is-a" relationship relate to inheritance? Give an example of such a relationship.

1 Answer

6 votes

Answer:

"is-a" relationship is used to indicate that a derived class belongs to the family of base class.

Step-by-step explanation:

IS-A relationship based on Inheritance, which can be of two types Class Inheritance or Interface Inheritance.

"is-a" relationship is used to indicate that a derived class belongs to the family of base class. For example vehicle is a class which belongs to car base class.

Any derived class that extends base class have " is-a " relation ship with base class

Any class that implement an interface also has " is-a " relation ship" with the interface

User James McCormack
by
8.2k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.