O'Reilly logo

Java™ How to Program, Seventh Edition by P. J. Deitel - Deitel & Associates, Inc., H. M. Deitel - Deitel & Associates, Inc.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

K.3. Documenting Java Source Code

In this section, we document a modified version of the Time2 class from Fig. 8.5 using documentation comments. In the text that follows the example, we thoroughly discuss each of the javadoc tags used in the documentation comments. In the next section, we discuss how to use the javadoc tool to generate HTML documentation from this file.

Documentation comments are placed on the line before a class declaration, an interface declaration, a constructor, a method and a field (i.e., an instance variable or a reference). The first documentation comment (lines 5–9) introduces class Time. Line 6 is a description of class Time provided by the programmer. The description can contain as many lines as necessary to provide ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required