Though usually overlooked, documenting source code while writing a program's logic is one of the developer's most important tasks. If not properly documented, even the original author might not understand the source code. Computer languages support source code documentation by providing special symbols that signal the beginning and end of source code descriptions. The symbols and descriptions are collectively known as comments. If the Java compiler encountered the following comment, it would generate an error.
Developers often use single-line comments to document code placed within methods.
As with multiline comments, you cannot nest doc comments. You can automatically extract and convert this information to HTML pages with a special tool called javadoc . We'll explore doc comments and javadoc in a future article that investigates classes and methods. For now, consult the Java 2 SDK documentation to learn more about doc comments and javadoc . In addition to comments, source code contains identifiers.