Compiler Error J0030

Invalid character constant

The compiler detected an attempt to assign an invalid character or character escape sequence to a variable of type char.

The following example illustrates this error:

public class Simple {
   
   char c = '\'; 
   // error: invalid escape character
   char x = '\\'; \* correct assignment of the backslash to the char
                     variable */
}