Multiple choice technology programming languages

Boolean size :

  1. 8 bit

  2. 1 bit

  3. machine dependent

  4. none of these

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The Java Virtual Machine specification does not define a precise size for boolean values. Different JVM implementations may use different amounts of memory to store boolean values - some use 1 bit (with bit-packing), others use 1 byte. This is intentionally left implementation-dependent for optimization purposes.

AI explanation

The size of a bool/Boolean type is not fixed by the language specification in many languages (such as C, prior to fixed-width guarantees) — it depends on the compiler and target platform's implementation. That's why it's described as machine/implementation dependent rather than a fixed number of bits like 1 or 8.