KnowledgeBoat Logo

ICSE Class 8 Computers Differentiate Between the Following

Distinguish between Character and String literal

Values & Data Types Java

ICSE

17 Likes

Answer

Character literalString literal
Character literals are written by enclosing a character within a pair of single quotes.String literals are written by enclosing a set of characters within a pair of double quotes.
Character literals are assigned to variables of type char.String literals are assigned to variables of type String.

Answered By

7 Likes