Page 115 - AP Computer Science A, 7th edition
P. 115
and then goes to a new line. The print method outputs an item without going to a new line afterward. An item to be printed can be a string, or a number, or the value of a boolean expression (true or false). Here are some examples:
In the last example, the value of x, 27, is converted to the string “27”, which is then concatenated to the string "Value of x is ".
To print the “values” of user-defined objects, the toString() method is invoked.
Escape Sequences
An escape sequence is a backslash followed by a single character. It is used to print special characters. The three escape sequences that you should know for the AP exam are