You can include Javadoc comments for any class, interface, method, constructor, or field declaration in a Java program. A Javadoc comment must appear in the source code immediately before the entity it describes.
A comment begins with the characters /**
, ends with the characters */
,
and consists of two parts: a description and tags. For
example:
/**
* This is a <doc> comment.
* @see java.lang.Object
*/
The description summarizes the declared entity.
The text may include HTML elements (such as <B>
and <I>
) for formatting. Heading elements (such as <h1>
and <h2>
) are reserved for use by Javadoc.
A tag is a special keyword within the
comment that Javadoc can process. Standard Javadoc tags appear
as @
tag_name and in-line tags appear within braces, as {@
tag}
.
You can use any number of tags (some types of tags can be repeated, while others cannot).
The description cannot continue after the tag begins.
For more information on how to write Javadoc comments, see the Sun Microsystems
web page at
http://java.sun.com/products/jdk/javadoc/writingdoccomments/index.html
.
For detailed information about Javadoc tags, see
http://java.sun.com/j2se/1.3/docs/tooldocs/solaris/javadoc.html
.
See also | |
---|---|
Generating Documentation With Javadoc |