<<< Contract Enforcement using Interfaces | Index | Java and Multiple Inheritance, Cont. >>> |
Multiple inheritance can be very useful in some cases.
Java uses multiple inheritance in a very limited way, only with interfaces.
Interfaces come with some serious limitations:
Methods cannot have default implementations, thus forcing the programmer to implement each method again and again in each class that implements the interface.
This often forces programmers to repeat code over and over again.
<<< Contract Enforcement using Interfaces | Index | Java and Multiple Inheritance, Cont. >>> |