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.
Answer
Assertion (A) is true and Reason (R) is false
Explanation
Assertion (A):
True. The
booleandata type in Java can only hold two possible values:trueorfalse.Reason (R):
False. In Java,
booleanvalues are not stored as integers. Java uses a special type to representbooleanvalues directly, without associating them with1or0.
Related Questions
The number of bytes occupied by a character array of four rows and three columns are:
- 12
- 24
- 96
- 48
Consider the array given below:
char ch[] = {'A','E','I','O', 'U'};Write the output of the following statements:
System.out.println(ch[0]*2);:- 65
- 130
- 'A'
- 0
The default value of a boolean variable is:
- False
- 0
- false
- True