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)]