package com.div.Base;
/**
* @author Wendy
* @version 1.0
* @since 1.8
*/
public class Doc01 {
String name; //属性
/**
* @author Wendy
* @param name
* @return
* @throws Exception
*/
public String test(String name) throws Exception{ //方法
return name;
}
}
加在类上就是类的注释,加在方法上就是方法的注释
打开命令行
![(https://img2024.cnblogs.com/blog/3528094/202410/3528094-20241004135053314-1271603535.png)]
用javadoc执行文件Doc0.java (因为有中文,设置编码和字符为UTF-8格式)
![https://img2024.cnblogs.com/blog/3528094/202410/3528094-20241004135454903-425443465.png]
生成首页文件
![(https://img2024.cnblogs.com/blog/3528094/202410/3528094-20241004135923694-2045688796.png)]