A boolean type variable can hold either true or false.
A boolean type variable can't hold numeric value.
a. 0 not equals to false
b. Non Zero values not equals to true
Boolean literals - true and false are reserved words and must be in lower case.
a. true not same as TRUE, True, TrUe etc
b. false not same as FALSE, False, FaLsE etc
Single character enclosed in single quotation marks
Escape Sequence
ASCII Value
UNICODE Character
Octal Character
SPACE is a valid character so it can be placed in single quotation marks.
TAB is a valid character so it can be placed in single quotation marks.
Backslash character () is used to form escape sequence so only backslash character can't be placed in single quotation marks.
Single Quote is used to form character literal so only single quote can't be placed in single quotation marks.
There are some characters like Backslash, Single quote which can't be placed in single quotes as it is. Those special characters have to be represented as Escape Sequence.
Every character enclosed in single quotation marks will have an integer equivalent value called as ASCII value.
char type variable can hold integer value ranging from 0 - 65535 only.
char type variable can hold UNICODE value ranging from \u0000 - \uFFFF only.
char type variable can hold OCTAL value ranging from \0 - \377 only.
When you print the char type variable which holds Integer, UNICODE or Octal value then it displays corresponding character representation.
If Integer, UNICODE value don't have character representation then it displays ? which indicates no character defined for that value.
When you assign character literals to int type variable then internally ASCII value of that character will be assigned.