在Java中,int,float,double等基本类型所占字节大小都有明确说明,唯独boolean类型没有,那么boolean类型的大小究竟是多少呢?
Java SE Specification(java 8)
先看java官方规范中怎么说,规范网址,下面是摘抄:
The boolean Type
Although the Java Virtual Machine defines a boolean type, it only provides very limited support for it. There are no Java Virtual Machine instructions solely dedicated to operations on boolean values. 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.