KnowledgeBoat Logo
|

Computer Applications

Explain various types of inheritance.

Encapsulation & Inheritance in Java

3 Likes

Answer

The various types of inheritance are as follows:

  1. Single Inheritance — When a class is derived from only one base class, it is known as single inheritance.
  2. Multiple Inheritance — When a sub class is inherited from multiple base classes, it is known as multiple inheritance.
  3. Hierarchical Inheritance — When many sub classes are inherited from a single base class, it is known as hierarchical inheritance.
  4. Hybrid Inheritance — When more than one type of inheritance forms are used together, it is known as hybrid inheritance.
  5. Multilevel Inheritance — When a sub class is inherited from a class that itself is being inherited from another class, it is known as multilevel inheritance.

Answered By

3 Likes


Related Questions