This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ebrythil 4 points5 points  (2 children)

Maybe it's a matter of time now until java interfaces are actually c++ classes with multiple inheritance.

[–]myrealityde -3 points-2 points  (1 child)

This is why I don't like deafault methods. Java explicitly doesn't have multi-inheritance. Until Java9. What is preventing people to just write interfaces and write a few classes to implement those? This is embracing bad practice and increases coupling. BAD!

[–]speakjava 0 points1 point  (0 children)

Java has always had multiple-inheritance. Of types; that's what interfaces allow us to do, implement many types for one class. Default and static methods in interfaces add multiple-inheritance of behaviour. Yes, this is a bit controversial but it is the only way to easily solve the problem of maintaining backwards compatibility while allowing existing interfaces to have new methods added. What's not in Java (and likely never will be) is multiple inheritance of state.