A Boolean data type is a data type with only two possible values: true or false.
The Boolean data type represents the simple True or False values of Boolean algebra.
Though one bit is all that is necessary to store a boolean (the 1 = true, 0 = false), it is often advantageous (if unintuitively so) to use larger amounts of memory.
Some programming languages actually define a three-valued logic within their Boolean type.
In java, the Boolean class is java.lang.Boolean
, the object version of primitive type boolean
, and questions may be related to either. Note that the java.lang.Boolean
fields may hold null
as well, as it's an Object
.