OOPs | 05-Inheritance

Inheritance

5. Inheritance

It is a mechanism that allows you to create a hierarchy of classes that share a set of properties and methods by deriving a class from another class. Inheritance is the capability of one class to derive or inherit the properties from another class.

  • It specifies that the child object acquires all the properties and behaviors of the parent object.
  • It provides re-usability of the code.
[Read More]