Java: Boolean (class) vs boolean (primitive)
Boolean is a class, or a reference type, defined in the standard library. It stores a reference to an object containing a value (a “box”).
boolean on the other hand, is a primitive type and part of the language itself. It stores an actual value.
We say that
Boolean is the wrapper type for
boolean, and objects of type
Boolean are boxed values.
Continue reading here: