13.2 Character Escape SequencesJava uses the escape sequences listed in Table 13.2 to represent certain special character values. These escape sequences may appear in any Java char or String literal.
Java characters, strings, and identifiers (e.g., field, method, and class names) are composed of 16-bit Unicode characters. The Unicode \u escape sequence may be used anywhere in a Java program (not only in char and String literals) to represent a Unicode character. Unicode \u escape sequences are processed before the other escape sequences described in Character Escape Sequences, and thus the two types of escape sequences can have very different semantics. A Unicode escape is simply an alternative way to represent a character which may not be displayable on non-Unicode systems. The character escapes, however, can represent special characters in a way that prevents the usual interpretation of those characters by the compiler. |
|