• Dear Guest, Please do NOT forget to join our JAVA JOBS (ONLY) FACEBOOK GROUP to be aware of latest JAVA openings, and you may also post any JAVA related queries/jobs.

How can we achieve Multiple Inheritance in Java ?

Directly we can't achieve Multiple Inheritance in Java.

Indirectly there are two ways, those are :

1. We can achieve Multiple Inheritance by implementing more than one Interfaces, because we can have chance to implement more than one Interfaces in Java.

2. Another indirect way to achieve Multiple Inheritance is, doing by repeated use of Single Inheritance.

: Class z extends A,B --- Inavallid (bcz direct way)

Class B extends A
} ---- those are vallid (bcz indirect way)
Class Z extends B

So, here Class z can have all the features of Class B and Class A, but here we are doing indirect way with the help of Single Inheritance.
Java permits numerous Legacy from claiming interface, Anyway best solitary Legacy for usage. Just Toward the way, those motivation behind the reason java doesn't actualize all the full numerous Legacy may be On account it makes ambiguities. Suppose you Might say "A extends B, C", et cetera both b and c need An work "void f(int)".