java development environment:
UTF-8 environment: Chinese characters account for 3 bytes, while char type occupies only one byte. Why is the following assignment method correct? (shouldn"t it be beyond the scope of char?)
char c = "";
java development environment:
UTF-8 environment: Chinese characters account for 3 bytes, while char type occupies only one byte. Why is the following assignment method correct? (shouldn"t it be beyond the scope of char?)
char c = "";
Java uses the Unicode code set, which takes up two bytes, and a Chinese character is also two bytes, so the char in Java can represent a Chinese character.