How Do I Document Packages in Java?

jjnguy picture jjnguy · Mar 8, 2009 · Viewed 53k times · Source

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

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

Answer

Gareth Davis picture Gareth Davis · Mar 8, 2009

As of 1.5 you can define a package-info.java file and provide a standard javadoc style comment for a package:

com/foo/package-info.java:

/**
 * com.foo is a group of bar utils for operating on foo things.
 */
package com.foo;

//rest of the file is empty

Language specification for packages