✏️ Explanatory Question
In Java, there are five types of inheritance:
Single Inheritance: In single inheritance, a class extends only one base class.
Multilevel Inheritance: In multilevel inheritance, a derived class is created from a base class, which itself is derived from another base class.
Hierarchical Inheritance: In hierarchical inheritance, a base class has multiple derived classes.
Multiple Inheritance (through interfaces): In multiple inheritance, a class can inherit from multiple interfaces.
Hybrid Inheritance: Hybrid inheritance is a combination of multiple inheritance and hierarchical inheritance. It is achieved by implementing multiple interfaces and using them to create a hierarchical class structure.