The problem of occupying space in Chinese

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 = "";
Mar.10,2021
A char in

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.

Menu