K.2. Documentation Comments

Before HTML files can be generated with the javadoc tool, programmers must insert special comments—called documentation comments—into their source files. Documentation comments are the only comments recognized by javadoc. Documentation comments begin with /** and end with */. Like the traditional comments, documentation comments can span multiple lines. An example of a simple documentation comment is

/** Sorts integer array using MySort algorithm */

Like other comments, documentation comments are not translated into bytecodes. Because javadoc is used to create HTML files, documentation comments can contain HTML tags. For example, the documentation comment

/** Sorts integer array using <B>MySort</B> algorithm */

Get Java™ How to Program, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.