{@value} has two forms. The first displays the value of the constant that it precedes, which
must be a static field. It has this form:
The second form displays the value of a specified static field. It has this form:
{@value pkg.class#field}
Here, pkg.class#field specifies the name of the static field.
The @version tag specifies the version of a class. It has the following syntax:
@version info
Here, info is a string that contains version information, typically a version number, such as
2.2. You will need to specify the -version option when executing javadoc in order for the
@version field to be included in the HTML documentation.
The General Form of a Documentation Comment
After the beginning /**, the first line or lines become the main description of your class, variable,
or method. After that, you can include one or more of the various @ tags. Each @ tag must
start at the beginning of a new line or follow one or more asterisks (*) that are at the start of
a line. Multiple tags of the same type should be grouped together. For example, if you have
three @see tags, put them one after the other. In-line tags (those that begin with a brace) can
be used within any description.
Here is an example of a documentation comment for a class:
* This class draws a bar chart.
* @author Herbert Schildt
* @version 3.2
What javadoc Outputs
The javadoc program takes as input your Java program's source file and outputs several
HTML files that contain the program's documentation. Information about each class will be
in its own HTML file. javadoc will also output an index and a hierarchy tree. Other HTML
files can be generated.
An Example that Uses Documentation Comments
Following is a sample program that uses documentation comments. Notice the way
each comment immediately precedes the item that it describes. After being processed
Search WWH :
Custom Search
Previous Page
Java SE 6 Topic Index
Next Page
Java SE 6 Bookmarks