Format of a Javadoc Comment

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. You can type a Javadoc comment directly in the Source Editor. If you need help with the content or format of a Javadoc comment, use the Auto Comment tool to create your comment.

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 the Javadoc executor.

A tag is a special keyword within the comment that the Javadoc executor 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
Adding a Javadoc Comment to Source Code
Generating Javadoc Documentation

Legal Notices