Type of inheritance

Table of contents

No heading

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

  1. 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.

  2. 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

  3. 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

  4. 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

  5. multiple inheritance (NOT SUPPORTED)