Java Booleans
Very often, in programming, you will need a data type that can only have one of two values, like:
- YES / NO
- ON / OFF
- TRUE / FALSE
For this, Java has a boolean
data type, which can store true
or false
values.
Very often, in programming, you will need a data type that can only have one of two values, like:
For this, Java has a boolean
data type, which can store true
or false
values.