All Javadoc commands can only appear in the "/**" comment. But peace is always the same, the annotation ends with a "* *". There are two main ways to use Javadoc: embedded HTML, or use document markup. where document tags (doc tags) are commands that begin with "@" and are placed at the beginning of the comment line (but the leading "*" is ignored).
There are three types of annotation documents that correspond to the elements that are behind the annotation: class, variable, or method. That is, a class annotation is just before a class definition, the variable annotation is just before the variable definition, and a method definition is right in front of a method definition. As shown in the following simple example:
/** a class Comment * *
public class Doctest {
/** a variable comment * *
public int i;
/** a method Comment * *
public void F () {}
}
Note Javadoc can only process the annotation document for public and protected (protected) members. Comments for members of private and friendly (see chap. 5) are ignored, and we do not have any output (and can also include private members with-private tags). This makes sense because only public and protected members can be used outside of the file, which is the hope of the client programmer. However, all class annotations will be included in the output result.
The output of the above code is an HTML file that has the same standard format as other Java documents. As a result, users are very familiar with this format and can easily "roam" through the classes you design. When you design your program, be sure to consider entering the code above and using Javadoc to see how the final HTML file will look.