The character is not surrounded by apostrophes. It should be: 'W' .
With double quotes, "W", you get a String that contains a single character.
This is not the same as a primitive single character.
A String is represented as an object and may consist of several hundred bytes.
A primitive character data item is always only two bytes.
boolean
Another of the primitive data types is the type boolean.
It is used to represent a single true/false value.
A boolean value can have only one of two values:
true false
In a Java program,
the words true and false always mean these
boolean values.
The data type boolean is named after George Boole,
a nineteenth century mathematician,
who discovered that a great many things can be done with
true/false values.
Although the amount of information in a boolean primitive is logically one bit,
for convenience Java uses more than that to represent it.
Would you like a data type named after you someday?
true false