Java Reference
In-Depth Information
7.2.3. Character Literals
Character literals appear with single quotes:
'Q'
. Any valid Unicode
character can appear between the quotes. You can use
\u
xxxx
for
Unicode characters inside character literals just as you can elsewhere.
Certain special characters can be represented by an
escape sequence:
newline
(\u000A
)
\n
tab
(\u0009
)
\t
backspace
(\u0008
)
\b
return
(\u000D
)
\r
form feed
(\u000C
)
\f
backslash itself
(\u005C
)
\\
single quote
(\u0027
)
\'
double quote
(\u0022
)
\"
a
char
by octal value, where each
d
is one of 07
\
ddd