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

What does char mean in Java?

little bottle
Release: 2020-09-18 16:14:25
Original
23509 people have browsed it

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'
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template