Documentation with javadoc

We have already relied on having you read and interpret documentation of existing classes in Java, such as those provided by Sun for the Java 2 Standard Edition API, or that provided by this course for the csa120 packages.

By now, you may have noticed a standard "look and feel" to such documentation. This is because Java provides a mechanism for generating such documentation directly from special "documentation comments" embedded in the source code for classes. Those documentation comments are multiline comments which being with the characters /** and end with */  (note the two asterisks in the opening marker). The use of such comments is briefly discussed in the text appendix, on pp. 825 and 838.

These documentation comments can then be used to generate the web pages by use of a tool known as javadoc, also distributed by Sun. Within BlueJ, you can invoke this tool by selecting "Project Documentation" from the "Tools" menu for your overall project.

To learn to write such documentation comments, we will:


Michael Goldwasser
Last modified: Monday, 23 February 2004