Inheritance in programming languages is a concept of OOP which supports hierarchical classification and reusability of code. A class is derived from another class and it shares common characteristics with the class from which it is derived.
Derived class is also known as child class or subclass and the class from which it is derived is called base class or parent class or ancestor class or super class. The new class derived generally has more features than the base class.
class Vehicle
{
//Attributes (data + functions)
};
class Car : public Vehicle
{
//Attributes (data + functions)
};
class Audi_r8 : public Car
{
//Attributes (data + functions)
};
The example given above shows multi-level inheritance. Class Audi_r8 is inherited from class Car, which in turn is inherited from class Vehicle.
Fact: Simula was the first programming language which had inheritance concept.