Re:Inheritance was invented as a performance hack
by pasc1878 on Friday May 09, 2025 @04:33AM
(#43934866)
Java (following Objective-C) does need a differentiation between interface and pure abstract class - this is because it is single inheritance - a class can have any one class to inherit from but it can have many interfaces.
Re:Inheritance was invented as a performance hack
by layer8 on Friday May 09, 2025 @08:19AM
(#43935947)
That doesn’t follow. The restriction could have been defined in terms of allowing at most one parent class to be non-pure-abstract. And there are lesser restrictions hat would have been conceivable as well. Java is single-inheritance only in the sense of the particular interface–class distinction it makes. For example, since Java 8 you can inherit method implementations from multiple interfaces.
The important thing is to distinguish between interface and implementation, and that is relevant to any class, whether it implements a separately defined interface or not.