Interface Inheritance
An interface is a class
that declares features but provides no implementation.
It is a specification that any implementing class must conform to.
Any variables contained within an interface are implicitly defined as public, static, and final,
and any methods are implicitly abstract
and public.
Classes that implement an
interface must provide an implementation for all of the methods declared in the
interface. A class implements zero or more interfaces, and an interface can extend
zero or more other interfaces. Classes, however, can extend
only one other class, even if it implements
one or more interfaces.
Implementing classes
implement the methods contained in the interface by overriding them.
This is done by declaring methods with the same type signature.
If the class is implementing more than one interface, all methods
contained in all interfaces should be overridden.
An example interface is
defined as follows:
public interface
Driveable {
boolean hasWheels() …
}