We will not be describing the javadoc processor in any more detail in this chapter, but you can read
about javadoc comments here: http://java.sun.com/j2se/javadoc/. In our opinion, the javadoc processor is
one of the magnificent contributions Java has made to programming practice. The javadoc processor uses
comments within the programs themselves to generate attractive and complete documentation of every
class. Wonderful!
As a matter of programming style, I like to put a comment following closing curly braces that tells me
which block of code is being terminated. Particularly when many code blocks are nested within one another,
such comments help me keep track of my curly brackets. This style is a personal preference, not a standard.
Adopt it only if you wish.
76 PROGRAMMING IN JAVA [CHAP. 5
/**
* A program to print the words to the Twelve Days of Christmas
* @author Carl Reynolds
*/
public class DaysOfChristmas {
public static void main(String args[]) {
int dayOfChristmas = 1; //start with the 1st day of Christmas
while( dayOfChristmas <= 12 ) {
if( dayOfChristmas == 1 )
{
System.out.println( "A partridge in a pear tree \n" );
}//if
else
{
switch( dayOfChristmas )
{
case 12: System.
Pages:
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212