Java Characters

Characters

The char data type is used to store a single character. The character must be surrounded by single quotes, like ‘A’ or ‘c’:

Example

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

 

Alternatively, if you are familiar with ASCII values, you can use those to display certain characters: Continue reading Java Characters