1.

Explain inheritance

Answer»

Inheritance is the process of creating new classes, called derived classes, from existing classes. These existing classes are called base classes. The derived classes inherit all the capabilities of the base class but can ADD new FEATURES and refinements of their own.

Example-

Inheritance in C++

Class BUS, Class Car, and Class TRUCK inherit the properties of Class Vehicle.

The most IMPORTANT thing about inheritance is that it permits code reusability.



Discussion

No Comment Found