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).
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