1. The literal of a char type can be an English letter, a character, or a Chinese character, and is included by a single quotation mark.
2. The Java bottom uses a 16-bit integer to handle the character type, which is the Unicode encoded value of a character.
Unicode:
1, Unicode encoding is a worldwide coding method.
2. The English part of Unicode encoding is compatible with ASCII code (ASCII denotes range 0~128), while English characters and numbers are encoded continuously.
3. Java, when processing data of type char, is processed by Unicode code at the bottom.
What is encoding?
The computer hardware system can only use 0 and 1 to represent the number, we have made the rule, a number can also represent a character.
void out () { for (int0; i++) { System. out. println ((char) i+":"+i); } }
Output look at the results
Escape characters:
The escape character is "\", which can represent some special characters by escaping the character.
For example:
' \ n ' means carriage return
' \ t ' represents a tab-stop character, a tab indicates a 8-10-character jump to the right
' \ \ ' means \
' \ ' denotes single quotation marks
' \ ' means double quotation marks
Java Base character type