I have come across this topic while reading interface in Java 8, there are scenarios where we define method in interface using default or static keyword, allowing the next child to either re-define the same method or implement it. Does that means multiple inheritance? There's one more issue that I found is that, return type must be co-variant type else compile issue, that means it still doesn't support multiple inheritance? Can we say that java supports multiple inheritance? Let me know more details in regard to this topic.
Does that means multiple inheritance?
For interfaces, yes, but not classes. It is usually classes people think of as only classes can have fields and constructors. This is no different to Java 1.0
return type must be co-variant type else compile issue, that means it still doesn't support multiple inheritance?
The need for covariant returns type is not related to whether you have multiple inheritance or not.
Can we say that java supports multiple inheritance?
For interfaces, yes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With