Java has a data type
boolean. Note the following:
booleancan be operated on with logical or bitwise operators, but cannot be treated as a 0 or 1 mathematically.
booleancan be specified as a parameter type or return value for a method.
booleanvalue will print as
The result of a
conditional expression (such as a comparison operation) is a
boolean value. Note that:
Conditional expressions are used for program control. That means they provide the ability for a program to branch based on the runtime condition or iterate through a block of code until the condition is false.