基本类型 | 大小 | 最小值 | 最大值 | 包装器类型 |
boolean | —— | —— | —— | Boolean |
char | 16bit | Unicode 0 | Unicode 2^16-1 | Character |
byte | 8bit | -128 | +127 | Byte |
short | 16bit | -2^15 | +2^15-1 | Short |
int | 32bit | -2^31 | +2^31-1 | Integer |
long | 64bit | -2^63 | +2^63-1 | Long |
float | 32bit | IEEE754 | IEEE754 | Float |
double | 64bit | IEEE754 | IEEE754 | Double |
void | —— | —— | —— | Void |
注:
2 ^ 15 = 32768
2 ^ 16 = 65536
2 ^ 31 = 2147483648
2 ^ 63 = 9223372036854775808
IEEE754标准是IEEE二进位浮点数算术标准(IEEE Standard for Floating-Point Arithmetic)的标准编号。