Arrangement relation of occupied bytes:
Short & lt= int<= long.
C language definition:
Short takes up at least 2 bytes.
Int is recommended as machine word length. The machine word length is 4 bytes in 32-bit environment and 8 bytes in 64-bit environment.
The length of short cannot be greater than int, and the length of long cannot be less than int.
Distinguish between multiple numerical types, its purpose lies in different occasions, and the requirements for numerical accuracy and the number of bytes occupied are also different, such as:
The month is only 12 months, and the month of 1 does not exceed 3 1 day. If it is used? Short? Define the month and? Date, at least 4 bytes; What if you use int? To define, at least 8 bytes are required.
2? Bytes? And 4 bytes seem to have little difference, but if the amount of data is large, the accumulation is considerable, especially in the network transmission process and some specific occasions. The fewer bytes, the faster and more efficient.