The number of bytes occupied by several data types in java is as follows:
As you can see from the picture above Int in java occupies 4 bytes.
Byte (Byte) is a unit of measurement used by computer information technology to measure storage capacity. It is a string of binary digits processed as a unit and is a small unit that constitutes information. The most commonly used byte is an octet, that is, it contains an eight-bit binary number.
Byte is the basic unit of computer:
1 and 0 are the basic units of computer storage, including everything seen on the computer now is composed of two numbers: 1 and 0 , one is a bit, 8 bits (bit) is a byte, the images and videos we see in the computer are all obtained by the computer through the calculation of countless 1s and 0s in the memory.
For more java knowledge, please pay attention to the java basic tutorial column.
The above is the detailed content of How many bytes does the int type occupy in java?. For more information, please follow other related articles on the PHP Chinese website!