Java Reference
In-Depth Information
Find the documentation online and either download it or bookmark the Web page so that
you can access it quickly. Throughout the remainder of the topic, I will ask you to view the
J2SE documentation for further information about specific classes and interfaces. The
javadoc looks for special comments in your source code that appear in the following format:
/**
*/
Comments that contain general information about the class appear directly before the
class declaration. Comments about a field, method, or constructor appear directly before
the member's declaration in the class. In addition, you can use one of the following javadoc
tags for specific types of comment information:
@author. Represents the name of the author or authors of the source code.
@depracated. Denotes a member of the class as depracated, meaning that the
API should no longer be used.
{@docRoot}. Represents the relative path to root directory where the current page
will be output. This is useful when providing a link to an outside URL.
@exception. Used by a method to list thrown exceptions.
{@link package.class#member label}. Creates a link to specified class member.
{@linkplain package.class#member label}. Same as {@link}, except that the
plain text font is used instead of the code font.
@param. Used to describe the parameters of a method.
@return. Used to describe the return value of a method.
@see. Creates a “See also” heading for providing links or comments about other
information the reader can check.
@since. Denotes a version number indicating when the member existed or was
changed.
@serial, @serialField, and @serialData.
Used for serialization purposes.
@throws. Same as the @exception tag.
{@value}. Used for displaying the value of a constant static field.
@version. Denotes the software version of the class.
The Television class, shown in the following listing, contains javadoc comments and
demonstrates using the javadoc tags:
package electronics;
/** The Television class is used to represent a standard TV
* that contains a channel and volume setting. This
* particular javadoc comment will appear at the beginning
* of the documentation page.
*
continued
Search WWH ::




Custom Search