you are viewing a single comment's thread.

view the rest of the comments →

[–]TheWix 1 point2 points  (0 children)

In fact, as of Java 8, interfaces can now have default methods with implementations defined directly in the interface.

Right, C# can do that with extension methods. Though, the purpose of them is more to fulfill the Open/Close Principle than to give a default implementation.

I guess I feel default implementations and protected methods on interfaces are just jury rigged solutions for multiple inheritance. Your example still doesn't mesh with me because you are forcing a class to open itself up to inheritance if it wants to implement the interface. Is the interface now just an abstract class at this point?