TheLQ TheLQ - 1 year ago 138
Java Question

Javadoc: package.html or

When trying to create package level Javadoc comments, whats the preferred method? What do you do?

  • Pros

    • Newer

  • Cons

    • Abuse of a class - Classes are for code, not for only comments


  • Pros

    • HTML extension means its not code

    • Syntax highlighting in IDE's/text editors

  • Cons

    • None?

For me, I've always used Package.html. But I'm wondering if its the correct choice.

Answer Source "This file is new in JDK 5.0, and is preferred over package.html."—javadoc - The Java API Documentation Generator

Addendum: The big difference seems to be package annotations. There's a little more in the way of rationale in 7.4 Package Declarations.

Addendum: The annotation feature is also mentioned here and here.

Addendum: See also Declarative Programming in Java: Package-Level Annotations.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download