Java Reference
In-Depth Information
Java Documentation
A unique and extremely useful feature of the Java language is the javadoc tool, which takes
comments from Java source code and generates HTML pages. This encourages develop-
ers to add comments to their code because the HTML pages can be used by fellow devel-
opers and anyone else who wants to know about a class, without looking at the actual
source code.
The documentation for the J2SE APIs was generated using the javadoc tool. This docu-
mentation is found on Sun's Web site at http://java.sun.com/j2se/ at the same URL from
which the SDK is downloaded (refer to Figure 1.1). You can download the documentation
or view it online. Note that the documentation does not come with the J2SE SDK that you
downloaded earlier.
Running the javadoc tool creates an HTML page for each class, which contains details
about the class. Information on a class's page includes its inheritance hierarchy; a summary
of the fields, constructors, and methods in the class; and detailed descriptions of each field,
constructor, and method.
Figure 9.6 shows a portion of the javadoc page for the java.lang.String class.
Figure 9.6
Documentation page for the String class.
Notice that the J2SE documentation is split into three frames. In the upper-left frame is
a list of all the packages in the J2SE. Click on a package name, and all the interfaces and
classes in that package appear in the lower-left frame. Clicking on a class name in the
lower-left frame causes that class's documentation page to appear in the large frame in the
center.
Search WWH ::




Custom Search