[Java basic learning] JavaDoc generates documentation

JDK help document address

https://docs.oracle.com/javase/8/docs/api

JavaDoc

The javadoc command is used to generate your own API documentation


JavaDoc parameter information

  • @author author name
  • @version version number
  • @since indicates the jdk version that needs to be used earliest
  • @param parameter name
  • @return Return value situation
  • @throws exception throw situation

Adding to the class is the comment of the class, and adding to the method is the comment of the method

/**
 * @author hu
 * @version 1.0
 * @since 1.8
 */    //类注释
public class Doc {
    
    
   String name;
    /**
     * @param name    //param 参数
     * @return
     */    //方法注释
   public String test(String name){
    
    
       return name;
   }
}

Open the folder
Insert picture description here
Insert picture description here

Use the command line to generate JavaDoc documents!

First enter the cmd window
Insert picture description here

Enter javadoc -encoding UTF-8 -charset UTF-8 Doc.java to Insert picture description here
open the index.html webpage,
Insert picture description here
go in and click on Doc.
Insert picture description here
Insert picture description here
Key: Command line command format: javadoc parameter Java file

Guess you like

Origin blog.csdn.net/weixin_44302662/article/details/114076897
Recommended