Home >Java >javaTutorial >What does char mean in Java?

What does char mean in Java?

little bottle
little bottleOriginal
2019-05-20 17:43:5823508browse

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.

What does char mean in Java?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:What does & mean in Java?Next article:What does & mean in Java?