Java Boolean is how many bytes
The Boolean type in Java is not given a precise definition, and in "Java Virtual Machine "Specification" gives the definition that the Boolean type is 4 bytes, and the Boolean array is 1 byte. The specifics depend on whether the virtual machine implementation follows the specification, so 1 byte and 4 bytes are both valid. possible.
The number of bytes occupied by Java basic data types
int 4 bytes (32 bits)
short 2 bytes (16 bits)
long 8 bytes (64 bits)
byte 1 byte (8 bits)
float 4 bytes (32 bits)
double 8 bytes (64 bits)
char 2 bytes (16 bits)
Recommended tutorial: "Java Tutorial"
The above is the detailed content of Java Boolean is how many bytes. For more information, please follow other related articles on the PHP Chinese website!