欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Use Java Doc to generate a yourself API document

程序员文章站 2022-06-07 15:57:22
...

Write your Java code in your workspace with annotation by IDEA

package com.qx.redis;

/**
 * @version 1.0
 * @Author: QX_He
 * DATA: 2020/8/9-23:55
 * Description:
 * @sicne 1.8
 **/
public class Doc {

    /**
     * @author qx_java
     * @param name
     * @return
     * @throws Exception
     */
    public String docTest(String name) throws Exception{
        return null;
    }
}

The annotations are as below five

@Author

@Version

@since

@param

@return

@throws

Perform java command in cmd terminal to packaging the java.class to a document

javadoc -encoding UTF-8 -charset UTF-8 yourJacaClass.java

Then,you can double click in index.html to check your java document whether was generated successfully in your computer path who is in the same path as your .java file .

相关标签: Command