There are four types of escape characters in Java:
Escape characters in JAVA:
1. Octal escape sequence: + 1 to 3 5-digit numbers; range '00'~'377'
:null character
2.Unicode escape character: u + four hexadecimal digits; 0~65535
u0000: null character
3. Special characters: just 3
": double quotes
': single quote
/: backslash
4. Control characters: 5
r Enter
n new line
f Paper feed and page change
t horizontal tab
b backspace
Rules for using these escape characters: Both ordinary escape character sequences and octal escape characters are much better than Unicode escape characters because, unlike Unicode escape characters, escape character sequences are parsed by the program into various symbols processed later. Unicode escape characters can cause confusion because they are processed too early in the compilation sequence. In summary, escape character sequences are preferred over Unicode escape characters in string and character literals.