Inheritance Blog Posts

Types of Inheritance in Java

Inheritance types:
On the basis of class, there can be three types of inheritance in java: single, multilevel and hierarchical.
In java programming, multiple and hybrid inheritance is supported through interface only.
Single Inheritance :
In single inheritance, subclasses inherit the features of one superclass. In image below, the class A serves as a base class for the derived class B.
Single Inheritance Example:
//SingleInheritance.java

0 Likes 1039 Views