In Java, which data type is used to represent true or false values?
A. boolean
B. bit
C. logic
D. binary
Answer: Option A
Solution(By Examveda Team)
The correct answer is Option A: boolean.In Java, the boolean data type is used to represent true or false values.
Here's the breakdown:
Option A: boolean - This is the correct data type for representing true or false values in Java.
Option B: bit - While bits are used in computer systems to represent binary values (0 or 1), there is no specific bit data type in Java for representing boolean values.
Option C: logic - There is no logic data type in Java for representing boolean values.
Option D: binary - This term refers to binary values, but it is not a data type used to represent boolean values in Java.
So, the correct choice for representing true or false values in Java is boolean.
Related Questions on Data Types and Variables
What is the maximum value that can be stored in a byte variable in Java?
A. 127
B. 255
C. 32767
D. 64
What is the default value of an int variable in Java if it's not explicitly initialized?
A. 0
B. 1
C. -1
D. Null
Which of the following is not a valid identifier for a Java variable?
A. my_var
B. _myVar
C. 3rdVar
D. $var
Join The Discussion