3 ms·
In Java it isn't but this is specific to Java (and clones of Java like C#). This is because Java has single-inheritance enforcement for classes. C++ for examp
by slver 5y ago
In Java it isn't but this is specific to Java (and clones of Java like C#).
This is because Java has single-inheritance enforcement for classes.
C++ for example has multiple inheritance. So the way you do an interface is you just write an abstract class, then extend it to implement it.
- johnmaguire 5y agoIn my experience, whether you use an abstract class or an interface class as your reference depends very much on the problem you are trying to solve - specifically, is there common code shared across all implementations?
- mtinkerhess 5y agoA C++ pure abstract class is equivalent to a Java interface.