新建 Hello.java 文件
public class Hello{
private String name;
private int age;
public Hello(String name, int age){
this.name = name;
this.age = age;
}
/**
* 控制台输出msg字符串
* @param msg 字符串
* @return 没有返回值
*/
public void sayHello(String msg){
System.out.println(msg);
}
}
在该目录下打开cmd,输入以下命令即可自动生成API文档
javadoc Hello.java -encoding utf-8 -charset utf-8
网友评论