Java Reference
In-Depth Information
2. In your CellPhone class, add javadoc comments for the class and the
methods, including author and version information.
3. From the command prompt, run the following javadoc command
from the c:\football directory:
javadoc -author -version *.java
4. If successful, the javadoc tool should have created a file in the
c:\football directory named index.html. Open this file in your Web
browser, and view the documentation, specifically the FootballLis-
tener interface.
The page index.html should contain a link to each of the four classes
and interfaces that you added javadoc comments to. You should be able
to see your comments as you browse through the documentation.
Summary
An interface is a collection of abstract methods that are implemented by
a class. A class uses the implements keyword to implement an interface.
■■
A class that implements an interface must implement each method
defined in the interface. If not, the class must be declared abstract.
■■
An interface can be used to expose certain methods of a class. An inter-
face can also be used to force a class to contain certain methods.
■■
An interface can contain fields. Each field in an interface is implicitly
public, static, and final.
■■
An interface can extend one or more interfaces.
■■
An interface with no methods in it is referred to as a tagging interface.
■■
Search WWH ::




Custom Search