Computer Applications
Assertion (A): The boolean
data type in Java can have only two possible values: true
or false
.
Reason (R): Boolean values in Java are stored as integers, with true
represented by 1 and false
by 0.
Values & Data Types Java
3 Likes
Answer
Assertion (A) is true and Reason (R) is false
Explanation
Assertion (A):
True. The
boolean
data type in Java can only hold two possible values:true
orfalse
.Reason (R):
False. In Java,
boolean
values are not stored as integers. Java uses a special type to representboolean
values directly, without associating them with1
or0
.
Answered By
2 Likes
Related Questions
Which of the following is a valid java keyword?
- If
- BOOLEAN
- static
- Switch
What are the resulting data type of the following explicit conversions?
int i; float f; double d; short s; char c; byte b;
(a) (float) i/b + d;
(b) (int)f*d + c/s;
(c) (char)i + f - b*d;
(d) (double) (f/i)*c + s;
(e) (char) d + b/i - f*s;
Which of the following type conversions in Java will result in a loss of precision?
Name the keyword which:
- indicates that a method has no return type.
- makes the variable as a class variable