June 2017
Beginner
1296 pages
69h 23m
English
... displays (the space character before the string’s closing double-quote character).
A single statement can display multiple lines by using newline characters (\n), which indicate to System.out’s print and println methods when to position the output cursor at the beginning of the next line in the command window. Like blank lines, space characters and tab characters, newline characters are white space characters. The program in Fig. 2.4 outputs four lines of text, using newline characters to determine when to begin each new line. Most of the program is identical to those in Figs. 2.1 and 2.3.
1 // Fig. 2.4: Welcome3.java2 // Printing multiple lines of text with a single statement.