Tutorials References Menu

Java char Keyword

❮ Java Keywords


Example

char myGrade = 'B';
System.out.println(myGrade);

Try it Yourself »


Definition and Usage

The char keyword is a data type that is used to store a single character.

A char value must be surrounded by single quotes, like 'A' or 'c'.


Related Pages

Read more about data types in our Java Data Types Tutorial.


❮ Java Keywords