Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Java introduces short, byte and char in detail, but I can't tell them apart.
Java introduces short, byte and char in detail, but I can't tell them apart.
Byte:byte occupies one byte in java, which means it is represented by 8 bits. Because it is a signed number, its representation range is-128- 127. If the range limit is exceeded during the operation, it will overflow.

Char:Char occupies two bytes in java, that is, 16 bits represent a data of char type. Because char is unsigned, its representation range is 0-65536. When the calculation is beyond its representation range, the system will automatically convert the result to int type.

Short: The two bytes occupied by Short:Java are also represented by 16 bits. Because short is signed data, its representation range is -32768-32767.

Can be used to save the use of memory as needed.