第一步、对一个工具类添加文档注释
对类的注释:
对方法的注释:
第二步、用工具解析文档注释
Javadoc 工具
格式:
java -d 目录 -author -version 类名.java
目录:就是写一个解析出来的文档存放的文件夹路劲
制作帮助文档出错:(找不到可以文档化的公共或受保护的类)
告诉我们工具类的权限不够。
第三步、查看生成的文档注释
在指定的目录文件夹中生成了一系列文件,我们只要打开 index.html 文件查看就可以了
我们需要工具类生成的class文件就可以调用工具类中的方法了
注:在java.lang包下的类不需要导包。