Inheritance is a vertical relationship among classes. This relationship enhances class reuse. A subclass (derived class) inherits all the features of its base (parent) class. Only the public and protected features can directly be accessed by the base class. The initializer (constructor) functions of the base class are not inherited; all classes are responsible for defining their initializer functions.
A subclass can be an extension and/or a specialization of the base class. If a subclass defines new features in addition to the ones that it inherits from the base class, then the subclass is said to be an extension to the base class. If a subclass redefines (overrides) one or more functions of the base class, then the subclass is said to be a specialization of the base class. The UML class diagrams show the inheritance relationships.