KnowledgeBoat Logo

Computer Applications

Distinguish between Character and Boolean literal

Values & Data Types Java

ICSE

147 Likes

Answer

Character literalBoolean literal
Character literals are written by enclosing a character within a pair of single quotes.A boolean literal can take only one of the two boolean values represented by the words true or false.
Character literals can be assigned to variables of any numeric data type — byte, short, int, long, float, double, charBoolean literals can only be assigned to variables declared as boolean
Escape Sequences can be used to write character literalsOnly true and false values are allowed for boolean literals

Answered By

84 Likes


Related Questions