To optimize memory access time, more than one bit is used to store a boolean value. In the Sun JVM all integer types smaller than 32 bits are promoted to 32 bits when pushed on the stack during execution. An array of booleans is treated as an array of bytes. ... In Java, the boolean type is not based on integers. In particular, the programmer cannot increment, decrement, or add boolean values. Inside a JVM, there are no instructions dedicated to booleans, and integer operstions are used. ... Despite popular belief, there is no speed advantage to bytes, shorts, or chars -- modern CPUs take the same amount of time to load or multiply 8 bits as they take for 32 bits.
Peter van der Linden currently leads a team of kernal programmers at Sun Microsystems,
Just Java 2.
Note that a boolean is controlled by one bit which is either on or off. It is, however, stored in various ways by the JVM depending on how it is being used.
[This message has been edited by Marilyn deQueiroz (edited November 28, 2001).]