However, in JavaDoc, the document is automatically generated upon some formatted comments. This is convenient. I searched for some conventions of writing effective and effecient javadoc comments and here are some main points:
the following contents are abstracted from SDN references:
Order of Block Tags
Include block tags in the following order:
* @param(classes, interfaces, methods and constructors only)* @return(methods only)* @exception(@throws is a synonym added in Javadoc 1.2)* @author(classes and interfaces only, required)* @version(classes and interfaces only, required. See footnote 1)* @see* @since* @serial(or @serialField or @serialData)* @deprecated(see How and When To Deprecate APIs)
Ordering Multiple Instances of Same Tags
Multiple @author tags should be listed in chronological order, with the creator of the class listed at the top.
Multiple @param tags should be listed in argument-declaration order. This makes it easier to visually match the list to the declaration.
Multiple @throws tags (also known as @exception) should be listed alphabetically by the exception names.
Multiple @see tags should be ordered as follows:
@see #field |
Required Tags
@param tag is "required" (by convention) for every parameter, even when the description is obvious.
@return tag is required for every method that returns something other than void, even if it is redundant with the method description. (Whenever possible, find something non-redundant (ideally, more specific) to use for the tag comment.)
How to Write Doc Comments for the Javadoc Tool