Q:

What Is Inheritance in c++?

0

What Is Inheritance in c++?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Answer:

Inheritance allows us to create a new class (derived or child class) from an existing class (base or parent class). The class whose members are inherited is called the base or parent class, and the class that inherits those members is called the derived or child class.

Example,

Class Cow, Class Dog, and Class Cat inherit the properties of Class Animal. And you can see the is-a relations ship between the Base class (Animal) and Derived classes (Cow, Dog, and Cat).

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C++ Interview Questions and Answers(2022)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
What is an abstraction in C++?... >>
<< What is encapsulation in c++?...