The javadoc Documentation Tool

javadoc, the Java documentation creator, takes a .java source code file or package name as input and generates detailed documentation in HTML format.

For javadoc to create full documentation for a program, a special type of comment statement must be used in the program's source code. Tutorial programs in this book use //, /*, and */ in source code to create comments—information for people who are trying to make sense of the program.

Java also has a more structured type of comment that can be read by the javadoc tool. This comment is used to describe program elements such as classes, variables, objects, and methods. It takes the following format:

/** A descriptive sentence or paragraph.
  * @tag1 Description of this ...

Get SAMS Teach Yourself Programming with Java™ in 24 Hours, FOURTH EDITION now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.