# Boolean

A Boolean value is a truth value and can be used as a condition.

Related concepts: ValueTypeConditional

*Closest Wikipedia entry:* Boolean data type — In computer science, the Boolean data type is a data type that has one of two possible values (usually denoted true and false) which is intended to represent the two truth values of logic and Boolean algebra. It is named after George Boole, who first defined an algebraic system of logic in the mid 19th century. The Boolean data type is primarily associated with conditional statements, which allow different actions by changing control flow depending on whether a programmer-specified Boolean condition evaluates to true or false.

## Misconceptions about Boolean7 documented Misconceptions

Check YourselfComparisonWithBooleanLiteral — Java

To test whether an expression is true or false, one must compare it to true or to falseMapToBooleanWithConditionalOperator — Java

To map a boolean expression to a boolean, a conditional operator is necessaryMapToBooleanWithIf — Java

To map a boolean expression to a boolean, an if statement is necessaryNoShortCircuit — Java

&& and || always evaluate both operandsNoSingleLogicAnd — Java

& is only a bitwise ANDNumericToBooleanCoercion — Java

Numeric types can be coerced to booleanReferenceToBooleanCoercion — Java

Every reference type can be coerced to boolean