Can we say that multiple inheritance in Java is made possible by implementing interfaces?
-
1see http://stackoverflow.com/questions/5003285/how-can-interfaces-replace-the-need-for-multiple-inheritance-when-have-existing – vandale Nov 21 '13 at 19:27
5 Answers
With default
methods in interfaces in java8
we will have multiple inheritance :)

- 4,422
- 6
- 30
- 35
It's not really "multiple-inheritance", you are simply outlining what the class should be able to do.
About as close a "multiple-inheritance" goes I suppose would be interfaces extending interfaces, really.

- 11,105
- 5
- 45
- 71
No. An interface defines how an implementation should communicate with the outside world you do not define any behavior. You can of course implement multiple interfaces but that doesn't mean that you have multiple inheritance, just that the class implementing the interfaces can appear as different things.

- 10,348
- 5
- 44
- 66
Nope. When you implement an interface, you are simply making a "promise" to implement certain methods in said class. When you extend another class, you inherit its methods and instance variables. Two completely separate things.

- 21
- 3