Character literals provide the most convenient way to express char values in Java source code. A character literal consists of:

For example:

char a = 'a';
char doubleQuote = '"';
char singleQuote = '\\'';

A line-break in a character literal is a compilation error:

char newline = '
// Compilation error in previous line
char newLine = '\\n';  // Correct