ExamVeda
Login
Home
Data Types and Variables
?

In Java, which data type is used to represent true or false values?

Answer & Solution
Correct Answer: Option A
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.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.