20 June 2022
20 June 2022
3. Hierarchal Inheritance
Single Inheritance
⚫ Every java class by default inherits from “java.lang.Object” class. ⚫
By this extension only, every user object gets the behavior of real
Object.
⚫ Hence every java class exhibits by default “Single Inheritance”. ⚫
Single Inheritance enables a derived class(Sub class) to inherit
properties and behavior from a single parent class
Multi-Level Inheritance
⚫ Accessing the functionality of objects in more than
one level is called “Multi-Level Inheritance”.
⚫ Child class accessing the functionality of grand
parent.
Hierarchal Inheritance
⚫ Sharing the properties of object to multiple child
objects is called “Hierarchal Inheritance”.