The Boolean type has two literal
values: true and false.Do not confuse the primitive Boolean
values true and false with the true
and false values of the Boolean
object. The Boolean object is a
wrapper around the primitive Boolean
data type. See Boolean Object for more
information.
What does this mean? What’s the difference between the Boolean object and the Boolean data type??
This is a boolean value:
This is a Boolean object wrapping the value:
Having the object adds a level of indirection. Try this to see the difference:
See also: