JavaDoc

  • JavaDocThe command is used to generate itselfAPIThe document
  • Parameter information:
    • @author: the author’s name
    • @version: the version number
    • @since: Indicates the earliest useJDKversion
    • @paramParameter name:
    • @return: Returns a value
    • @throws: Exception thrown
package demo;

/ * * *@authorThe foam of all evil is white@version 1.0
 * @#since 1.8
 */
public class Doc {

    String name;

    /** * set name **@paramName the name * /
    public void SetName(String name) {
        this.name = name;
    }

    /** * get name **@returnName * /
    public String getName(a) {
        returnname; }}Copy the code

To generate the javaDoc document, execute the following command

Javadoc -encoding UTF-8 -charset UTF-8 Sets the character set format to prevent Chinese garble. Javadoc -encoding UTF-8 -charset UTF-8 doc.javaCopy the code

After execution, some files can be generated

Here is the documentation for the generated Doc