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.
Join The Discussion