The Java char keyword is a primitive data type. It is used to declare the character-type variables and methods. It is capable of holding the unsigned 16-bit Unicode characters.

It is because Java uses Unicode system not ASCII code system.
The \u0000 is the lowest range of the Unicode system.
Let's see a simple example of displaying characters.
Output:
char1: a char2: A
In this example, we provide integer value to char variable. Here, compiler implicitly typecast integer to char and display the corresponding ASCII value.
Output:
char1: A char2: a
In this example, we typecast the integer value to char explicitly.
Output:
char1: a char2: A
Let's see an example to represent the char value in Unicode System.
Output:
char1: a char2: A
In this example, we increment the provided char value by 1.
Output:
char: B
Let's see an example to break the string in the form of characters.
Output:
String: javatpoint char: [j, a, v, a, t, p, o, i, n, t]
Let's see an example to invoke the method of the char return type.
Output:
a
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India