Computer Programming I
-
29
-
Escape Sequences
•
What If
we wanted to print
the
quote character?
•
The following line would confuse the compiler because it
would interpret the second quote as the end of the string
•
System.out.println
("I said "Hello" to you.");
•
An escape sequence is a series of characters that
represents a special character
•
An escape sequence begins with a backslash character (
)
•
System.out.println
("I said
"Hello
"
nto
you.");