Computer Applications
Distinguish between Character and Boolean literal
Values & Data Types Java
ICSE
147 Likes
Answer
Character literal | Boolean 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, char | Boolean literals can only be assigned to variables declared as boolean |
Escape Sequences can be used to write character literals | Only true and false values are allowed for boolean literals |
Answered By
84 Likes
Related Questions
Assign the following to a variable with suitable data type.
(a) m = 22 / 7
(b) p= 1.4142135 (value of square root of 2)
(c) k= 0.00004545
(d) n=24.50
Classify the following as primitive or non-primitive data types.
(a) char
(b) arrays
(c) int
(d) classes
Distinguish between Token and Identifier
Explain the term type conversion. How is implicit conversion different from explicit conversion?