Java-基本类型|Java-基本类型 boolean

1:存储空间java虚拟机规范中没有明确的指出,网上找的的答案是说根据虚拟机的实现有关,以下是网上找的的虚拟机规范的一部分。原文,以下是有关boolean 的虚拟机规范一部分。C/C++中bool true 为1 false为0
Instead, expressions in the Java programming language that operate on boolean values are compiled to use values of the Java virtual machine int data type.

Where Java programming language boolean values are mapped by compilers to values of Java virtual machine type int, the compilers must use the same encoding. 而:Java virtual machine type int, whose values are 32-bit signed two's-complement integers。
Arrays of type boolean are accessed and modified using the byte array instructions
In Sun's JDK releases 1.0 and 1.1, and the Java 2 SDK, Standard Edition, v1.2,boolean arrays in the Java programming language are encoded as Java virtual machine byte arrays, using 8 bits per boolean element
2:她的值只有两种true和false,和C/C++ 的(非零即是真)不同。
【Java-基本类型|Java-基本类型 boolean】3:初始化默认值false

    推荐阅读