Output, Literals, and Escape Sequences

Java displays text with two calls, System.out.println and System.out.print. Here they print the departure board at one bus stop.
print and println
System.out.print("Route 42");
System.out.print(" to Harbor");
System.out.println(" (on time)");
System.out.println("Departs 9:15");
The first call displays Route 42, and the cursor stays just after the 2. The second call writes at the cursor, and so does the third, which then ends the line. The fourth call writes on the new line. So the board shows two lines.
Route 42 to Harbor (on time)
Departs 9:15
Four statements made two lines, and in this code a new line starts only where a println finishes.
A call to println with nothing in its parentheses is legal. It displays nothing and ends the line, so right after another println it leaves a blank line on the board. A call to print with empty parentheses doesn't compile.
Literals
The values typed into those calls are literals. The text "Departs 9:15" is a string literal, and its double quotes mark where the text starts and ends. They aren't part of the text, so the board shows Departs 9:15 with no quotes around it.
A number written in code is a literal too. In System.out.println(42); the 42 is an int literal, and the call displays the digits 42. A literal like 9.5 is a double literal, and true is a boolean literal.
Escape sequences
Some characters can't be typed into a string literal as they are. A double quote would end the literal, so the board can't show a stop's name in quotes by typing the quotes plainly.
System.out.println("Stop "Elm St" is closed");
That line doesn't compile. The literal ends at the second quote, and Elm St is left outside it. Java writes a quote inside a literal as a backslash followed by the quote.
System.out.println("Stop \"Elm St\" is closed");
This displays Stop "Elm St" is closed. Each \" stands for one quote character, and the two outer quotes still mark the ends of the literal.
Since a backslash starts an escape sequence, a backslash that should appear on the display is typed twice. The board marks a transfer stop with the code 7\B.
System.out.println("Transfer code 7\\B");
Java reads \\ as one backslash, so the line displays Transfer code 7\B. With a single backslash, Java would read \B as an escape sequence. There's no such sequence, so the line wouldn't compile.
The newline escape ends a line from inside a literal, the way println ends one after a call.
System.out.println("Route 7: 9:40\nRoute 9: 9:52");
This one call fills two lines. The \n ends the first line, Route 7: 9:40, in the middle of the literal. The rest, Route 9: 9:52, goes on the next line, and println ends that one.