Home >Java >javaTutorial >What does char mean in Java?
We all know that Java has eight basic data types, namely: byte, short, int, long, float, double, boolean, and char. But do you know what it specifically means? Please join me to find out more below.
char is one of the eight basic data types in Java.
char is called "character type" in Java and occupies 2 bytes.
Character constant is a character enclosed in single quotes, and the character constant stores in memory the sorting position of the character in the Unicode character set, is the integer .
For example:
char x='a'
The memory x stores the sorting position 97 of character a in the Unicode character set, so the above statement is allowed to be written as char x=97;
Related learning recommendations: java basic tutorial
The above is the detailed content of What does char mean in Java?. For more information, please follow other related articles on the PHP Chinese website!