The primitive data type boolean in Java can have the values ________ or ________.
- Yes, No
- True, False
- 0, 1
- Positive, Negative
In Java, the boolean data type can only have two possible values: true or false. These values represent binary logic where true means "yes" or "on," and false means "no" or "off." It is essential to understand the fundamental concept of boolean data type for conditional expressions and logical operations in Java.
Loading...
Related Quiz
- Which of the following data structures does not allow duplicate elements?
- How can one ensure that a particular section of code does not have concurrent access by multiple threads?
- The reduce() method in Java 8’s Stream API is used to ________.
- Can an abstract class in Java have methods that are not abstract?
- The keyword ________ is used within a constructor to call another constructor in the same class.