Interfaces

Java introduces an intersting idea called an Interface. An interface is similar to a class, but no implementation is provided for the methods. Instead, new classes must provide the implementation for all interface methods.

Interfaces thus embody subclassing for specification.

Interfaces can be put into an inheritance hierarchy, and you can even have multi inheritance in interface hierarchies.

Interfaces embody the idea of a subtype relation. Since interfaces are separate from subclassing, they permit the creation of subtypes that are not necessarily subclasses.

[audio] [real] Text to accompany slide19, in Chapter 10 of An Introduction to Object-Oriented Programming