|
|
|
|||
|
Implementing the Sleeper InterfaceImplementing an Interface in the previous lesson already showed you how to implement an interface. Here, theGUIClock class implements
one interface--Sleeper:
Remember that when a class implements an interface, it is essentially
signing a contract. The class must provide method implementations for
all of the methods declared in the interface and its superinterfaces.
Or, the class must be declared abstract.
The method signature (the name
and the number and type of arguments) for the method in the class must
match the method signature as it appears in the interface.
| |||
|