Type of inheritance
Table of contents
No headings in the article.
Definition → Creating a new class (sub class) that acquires all the properties of another class is called is inheritance.
In java we achieve concept of inheritance with the help of extends keyword.
THERE ARE MAINLY 5 TYPE OF INHERITANCE
Single inheritance —> when the only one sub class acquired the properties of super class is called as single inheritance . OR when one sub class will inherits the properties of super() is class.
Multi level inheritance —> When we have more than two Sub Class and that subclass access the properties of their super class and the that class itself inherits from there super class
Hierarchical inheritance —> If we have more than two sub class and that sub class inherits the properties from the one super class is called as hierarchical
Hybrid Inheritance —> it is a concept of both multilevel and hierarchy inheritance in this all the sub class access the properties from the super class and that class itself inherits from the super class is called as hybrid
multiple inheritance (NOT SUPPORTED)