Embedded HTML
Javadoc passes HTML commands through to the generated HTML document. This allows you full use of HTML; however, the primary motive is to let you format code, such as:
/**
* <pre>
* System.out.println(new Date());
* </pre>
*/
You can also use HTML just as you would in any other Web document to format the regular text in your descriptions:
/**
* You can <em>even</em> insert a list:
* <ol>
* <li> Item one
* <li> Item two
* <li> Item three
* </ol>
*/
Note that within the documentation comment, asterisks at the beginning of a line are thrown away by javadoc, along with leading spaces. Javadoc reformats everything so that it conforms to the standard documentation appearance. Don’t use headings such as <h1> or <hr> as embedded HTML, because javadoc inserts its own headings and yours will interfere with them.
All types of comment documentation—class, variable, and method—can support embedded HTML.