Example
java
char myGrade = 'B';
System.out.println(myGrade);
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'.
The `char` keyword is a data type that is used to store a single character.
char myGrade = 'B';
System.out.println(myGrade);
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'.