How Do I Document Packages in Java?

前端 未结 3 1291
伪装坚强ぢ
伪装坚强ぢ 2020-12-04 08:37

In the Java APIs I can see Javadoc comments for packages.

How/where do I place Javadoc comments to document a package?

3条回答
  •  情书的邮戳
    2020-12-04 09:11

    Up to and including Java 1.4, you had to provide a HTML file package.html, as described in the other answers.

    Since Java 1.5 you can also provide a package-info.java, which contains a regular Javadoc comment (no HTML). The latter is preferred, as it gives you some extra features (notably package annotations).

    Details: Sun's docs for javadoc

提交回复
热议问题