Does Java 8 support multiple inheritance?

I came across this topic when reading an interface in Java 8, there are scenarios where we define a method in an interface using a default keyword or a static word, allowing the next child to either override the same method or implement it. Does this mean multiple inheritance? There, another problem that I discovered is that the return type must be a co-variant type else to compile the problem, that is, it still does not support multiple inheritance? Can we say java supports multiple inheritance? Let me find out more about this topic.

+5
source share
2 answers

Does this mean multiple inheritance?

For interfaces, yes, but not classes. Usually these are classes that people think of, since only classes can have fields and constructors. This is no different from Java 1.0.

should the return type be a co-option of the else type to compile the problem, does that mean it still does not support multiple inheritance?

The need for a covariant type of return is not related to the presence of multiple inheritance or not.

Is it possible to say that java supports multiple inheritance?

For interfaces, yes.

+6
source

Interface, Interface .. Everything is all right .. Thanks

-2
source

All Articles