Multiple Inheritance

This lesson discusses the limitations of multiple inheritance in Java.

We'll cover the following...

Question # 1

Is multiple class inheritance supported in Java?

In multiple inheritance a derived class extends or inherits from two or more classes.

Java doesn't support multiple class inheritance. A derived class can only extend a single super class.

Question # 2

Is multiple interface inheritance supported in Java?

The Java programming language supports multiple inheritance of type, which is the ability of a class to implement more than one interface. An object can have multiple types: the type of its own class and the types of all the interfaces that the class implements.

Implementing an interface is not the same as extending a class. The implementing class doesn't inherit any behavior from the interfaces, other than default methods and constants. Some developers would say implementing multiple interfaces one can simulate multiple inheritance, however, though that gets us closer to multiple inheritance it is still not true multiple inheritance as the implementing class will not inherit mutable state.

Thought of another way, interfaces allow multiple inheritance of types. Multiple inheritance allows one object to act like it belongs to ...