Then it uses an if-else statement to decide whether this
is the first verse or one of the later verses; that is necessary because the line about a partridge in a pear tree has
the word ???And??? in it for the 2nd through 12th verses, but not for the 1st verse. The \n at the end of the lines
having to do with a ???partridge in a pear tree??? is an example of an escape sequence. An escape sequence begins
with a backslash, and the following character has special meaning for the Java compiler. The \n means to insert
a linefeed, so that there will be a blank line between verses. There are other escape sequences for tabbing and
other functions, too.
Finally, this program illustrates how to add comments to a program written in Java. Any typing that follows
// on a line is treated as a comment; that is, the typing is ignored by the Java compiler. Also, any typing
between the characters /* and */ is also a comment, and such comments can extend over multiple lines. If
such a multiline comment begins with /**, it is a javadoc (Java documentation) comment, and will be included
by the javadoc processor in the automatically generated documentation of the program. Javadoc
comments can include special tags, such as @author, which the javadoc processor recognizes when it
generates the HTML format of the documentation.
Pages:
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211