As the name suggests, Inheritance means inheriting properties of a parent class by a child. The child class inherits – attributes and methods – of its parent class while reserving the ability to enhance itself with additional attributes and methods.

Consider the case of all vehicles on road. If vehicle is on a road it should have a registered owner and a chassis number. That is property of any vehicle on road. However, there are different types of vehicles – two wheelers, light four wheelers and heavy four wheelers. They have different properties like for a light four wheeler, its transmission and maximum seating capacity is important which might or might not be true for other two.

In the above example, Vehicle itself is a parent class (superclass) which has three child classes (subclasses)-  two wheelers, light four wheelers and heavy four wheelers. While child classes do inherit properties from Vehicle i.e. registered owner and chassis number; they have their individual properties as well which are limited to them only. A heavy four wheelers class doesn’t care about maximum seating capacity. It cares about how much weight can be put on the axle.

Now, it is possible that a class might want to inherit properties from two parents. However, SAP doesn’t support having multiple superclasses. Only one superclass is allowed. This is called single inheritance. Though, as you might have guessed by now, a superclass can have a number of subclasses.