A program should be documented so that anyone looking at the code could understand how it is supposed to work. Documentation simplifies debugging and permits other programmers to use the methods defined in the program to write their own program.
To document a program, the programmer adds comments to the code. Comments are ignored by the compiler. Java permits three kinds of comments.
//
is treated as a comment./* and the characters
*/ is treated as a comment.
/** and the characters
*/ is treated as a comment and is also used by the
javadoc tool in creating documentation for the program.
javadoc also recognizes particular keywords within these
comments; for example, @return is treated as preceding a characterization of what a method returns.
For more on how to use comments and javadoc, see the
Javadoc Tool Home Page.