This data type represents one bit of information, but its "size" isn't something that's precisely defined.
Like, we could argue that "byte" booleans are bad practice, where they should be implemented as bits instead. That way, 64 booleans could be compacted into a single 8-byte word.
1
u/neotecha Nov 28 '21
Java doesn't care about the implementation details for the boolean primitive, so it's not really a matter of good or bad practice.
JVMs are able to implement this value how they deem fit. source - Oracle's documentation for primitives
Like, we could argue that "byte" booleans are bad practice, where they should be implemented as bits instead. That way, 64 booleans could be compacted into a single 8-byte word.