Inheritance

Inheritance lets you reuse existing code and data structures in new applications. In C++, inheritance is implemented through class derivation. You can extend a library of existing classes by adding data elements and operations to existing classes to form derived classes. A derived class has all the members of its parent or base class, as well as extensions that can provide additional features. When you create a new derived class, you only have to write the code for the additional features. The existing features of the base class are already available.

A base class can have more than one class derived from it. In addition, a derived class can serve as a base class for other derived classes in a hierarchy. Typically, a derived class is more specialized than its base class.

A derived class can inherit data members and member functions from more than one base class. Inheritance from more than one base class is called multiple inheritance.



Inheritance
Multiple Inheritance


Derivation