Multiple Inheritance
In multiple inheritance, one class can have more than one superclass and inherit features from all parent classes. Note that Java does not support multiple inheritance with classes. In Java, we can achieve multiple inheritance only through interface .
In the figure below, class C is derived from interface A and B .
|
It is a mix of two or more of the above types of inheritance.
Since Java doesn’t support multiple inheritance with classes, the hybrid inheritance is also not possible with classes.
In Java, we can achieve hybrid inheritance only through interface .
|
“The secret of life, though, is to fall seven times and to get up eight times.” ― Paulo Coelho, The Alchemist |