1、Javadoc命令在/**中出现,结束于*/
2、使用Javadoc的两种主要方式:嵌入HTML、文档标签(以@开头)
2.1嵌入HTML
2.1.1
package day1;
/**类注释*/
public class Documentation1 {
/**域注释*/
public int i;
/**方法注释*/
public void name() {
}
}
2.1.2
package day1;
public class Documentation2 {
/**
* <pre>
* System.out.println(new Date());
* </pre>
*
* */
}
2.1.3
package day1;
public class Documentation3 {
/**<em>插入列表</em>
*<ol>
*<li>li1
*<li>li2
*<li>li3
*</ol>
*/
}
tips:不使用标题标签,如<h1></h1>
2.2文档标签(以@开头),详细查看JDK文档
@see:引用其他类
{@link package.class#member label}
{@docRoot}
{@inheritDoc}
@version
@author
@since
@param
@return
@throws
例子:
package day1;
/**
* @author 1
* @version 1.0
*
*
* */
public class Test {
/**
* @param 无参
* @throws 无异常
*
* */
public void name() {
}
}