Java Reference
In-Depth Information
NOTE
Documentation comments can also be used for documenting a package and preparing an
overview, but the procedures differ from those used to document source code. See the
javadoc
documentation for details on these uses.
@author
The
@author
tag documents the author of a class or interface. It has the following syntax:
@author
description
Here,
description
will usually be the name of the author. You will need to specify the
-au-
thor
option when executing
javadoc
in order for the
@author
field to be included in the
HTML documentation.
{@code}
The
{@code}
tag enables you to embed text, such as a snippet of code, into a comment.
That text is then displayed as-is in code font, without any further processing such as HTML
rendering. It has the following syntax:
{@code
code-snippet
}
@deprecated
The
@deprecated
tag specifies that a program element is deprecated. It is recommended
that you include
@see
or
{@link}
tags to inform the programmer about available alternat-
ives. The syntax is the following:
@deprecated
description
Here,
description
is the message that describes the deprecation. The
@deprecated
tag can
be used in documentation for fields, methods, constructors, classes, and interfaces.
{@docRoot}
{@docRoot}
specifies the path to the root directory of the current documentation.
@exception
The
@exception
tag describes an exception to a method. It has the following syntax: