I'm going through this
Java Tutorial page on interfaces:
http://docs.oracle.com/javase/tutorial/java/IandI/interfaceAsType.html
At the end of the page, it says:
"These methods work for any "relatable" objects, no matter what their class inheritance is. When they implement Relatable, they can be of both their own class (or superclass) type and a Relatable type. This gives them some of the advantages of multiple inheritance, where they can have behavior from both a superclass and an interface."
I don't fully get this "This gives them some of the advantages of multiple inheritance, where they can have behavior from both a superclass and an interface."
Because the two objects that can be compared using isLargerThan(obj1, obj2) are of the same class, and that class must implement isLargerThan(). So if the class implements multiple interfaces, to satisfy the "contract" of the interfaces, that class must implement the interface methods, so they are not inheriting those methods, but are implementing the methods. Implementing the interfaces just enforces them to implement those methods.
Am I wrong on this? I can never get how interfaces allow a form of multiple inheritance, because it seems when you implement multiple interfaces, you don't "get" anything extra, you are just "required" to implement something.
Please help. :-)