Java4teachus

Tuesday, July 16, 2019

Multiple inheritance and Hybrid Inheritance in Java

Multiple Inheritance



Definition

If a class is derived from "Two or more classes", it can be called as multiple inheritance. (OR) In this inheritance their exist multiple base classes and one single derived class. The below example shows the multiple inheritance. 

Example
Multiple-Inheritance-In-Java.jpeg

➤ In Java programming never support multiple inheritance to the concept of classes because it  contain ambiguity problems.
➤ Multiple inheritance does support in java by the concept of interfaces.

Hybrid Inheritance

Definition

hybrid inheritance is equal to the combination of any type of inheritance type. In this combination one of the combination is multilevel inheritance and multiple inheritance is called as hybrid inheritance which is shown below image.

Example:1
Hybrid-Inheritance-In-Java.jpeg
 Example:2
Hybrid-Inheritanc-In-Java.jpeg
➤ In Java programming never support hybrid inheritance to the concept of classes because it  contain ambiguity problems.
➤ Hybrid inheritance does support only in java by the concept of interfaces.

No comments:

Post a Comment

Thanks for visiting my site..