Sunday, January 15, 2017

inheritance in java

Inheritance in java is a mechanism in which one object acquires all the properties and behaviors of parent object.

The class which inherits the properties of other is known as subclass (derived class, child class) and the class whose properties are inherited is known as superclass (base class, parent class).


Inheritance represents the IS-A relationship, also known as parent-child relationship.


Example of Single Inheritance






Example of Multilevel Inheritance




Example of Heirarchical Inheritance