3 ms·
You can still not have member variables, so the default implementations can only be implemented in terms of other methods. So it should probably be classified a
by danieldk 11y ago
You can still not have member variables, so the default implementations can only be implemented in terms of other methods. So it should probably be classified as 'limited multiple inheritance'. It does have the diamond problem though.
- scott_s 11y agoThat was my immediate thought - this is closer to multiple inheritance, as it introduces the diamond problem: https://en.wikipedia.org/wiki/Multiple_inheritance#The_diamond_problem https://en.wikipedia.org/wiki/Multiple_inheritance#The_diamo... According to that page, Java forces programmers to resolve the ambiguity by making it a compiler error. A reasonable approach, I think. I've done more OO development in C++, and I've found this technique useful - putting a default implementation in a class which was mostly an interface because only a small number of subclasses needed specialized behavior.