Javadoc CSC 172 SPRING 2002 EXTRA LECTURE
TWO AMAZING FACTS The average college student spends $375/yr on textbooks. The average college student spends $1750/yr on pizza and beer.
JAVADOC A documentation comment can be extracted and used by the javadoc utility to generate HTML documentation for a program begins with “/**” ends with “*/”
Documentation comments A single documentation comment can be placed immediately preceding Class and interface definitions Member method definitions Member variable definitions If placed elsewhere, it is treated as a regular comment
Example /** * This class implements a generic stack. An array is * used to implement the stack. K.A.M. 1.1 */ public class Stack{ /*class def*/ }
Inside the comment Leading white space & asterisks are ignored The first sentence is used as a summary A period ends the first sentence HTML tags allowed The first line beginning with ends the general description section and begins the Javadoc tags
Javadoc Tags General Tags with the same name must be grouped together Some tags have pre-assigned formatting Text can contain HTML tags
Common Javadoc tags C=class, I==interface,M=method,V=Member exception thrown an in line a version as current version
Example Run