数据类型 | 长度 | 最大值 | 最小值 | 模(范围) |
---|---|---|---|---|
byte | 1byte | 值:2^8-1 hex: 007F dec: 127 oct: 177 bin: 0111 1111 |
值:-2^8 hex: FF80 dec: -128 oct: 1 777 777 777 777 777 777 600 bin: 1000 0000 |
2^8 = 256 |
char | 2byte | 值:2^15-1 hex: 7FFF dec: 32,767 oct: 77 777 bin: 0111 1111 1111 1111 |
值:-2^15 hex: FFFF 8000 dec: -32,768 oct: 1 777 777 777 777 777 700 000 bin: 1000 0000 0000 0000 |
2^16 = 65,536 |
short | 2byte | 值:2^15-1 hex: 7FFF dec: 32,767 oct: 77 777 bin: 0111 1111 1111 1111 |
值:-2^15 hex: FFFF 8000 dec: -32,768 oct: 1 777 777 777 777 777 700 000 bin: 1000 0000 0000 0000 |
2^16 = 65,536 |
int | 4byte | 值:2^31-1 hex: 7FFF FFFF dec: 2,147,483,647 oct: 17 777 777 777 bin: 0111 1111 1111 1111 1111 1111 1111 1111 |
值:-2^31 hex: 8000 0000 dec: -2,147,483,648 oct: 20 000 000 000 bin: 1000 0000 0000 0000 0000 0000 0000 0000 |
2^32 = 4,294,967,296 |
long | 8byte | 值:2^63-1 hex: 7FFF FFFF FFFF FFFF dec: 9,223,372,036,854,775,807 oct: 777 777 777 777 777 777 777 bin: 0111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 |
值:-2^31 hex: 8000 0000 0000 0000 dec: -9,223,372,036,854,775,808 oct: 1 000 000 000 000 000 000 000 bin: 1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |
2^64 = 18,446,744,073,709,551,616 |
Short值 | 二进制表示 |
---|---|
Short.MIN_VALUE | 1000 0000 0000 0000 |
. . . |
. . . |
-3 Short类型 | 1111 1111 1111 1101 |
-2 Short类型 | 1111 1111 1111 1110 |
-1 Short类型 | 1111 1111 1111 1111 |
0 Short类型 | 0000 0000 0000 0000 |
1 Short类型 | 0000 0000 0000 0001 |
2 Short类型 | 0000 0000 0000 0010 |
3 Short类型 | 0000 0000 0000 0011 |
. . . |
. . . |
Short.MAX_VALUE | 0111 1111 1111 1111 |
Integer值 | 二进制表示 |
---|---|
Integer.MIN_VALUE | 1000 0000 0000 0000 0000 0000 0000 0000 |
. . . |
. . . |
-3 Integer类型 | 1111 1111 1111 1111 1111 1111 1111 1101 |
-2 Integer类型 | 1111 1111 1111 1111 1111 1111 1111 1110 |
-1 Integer类型 | 1111 1111 1111 1111 1111 1111 1111 1111 |
0 Integer类型 | 0000 0000 0000 0000 0000 0000 0000 0000 |
1 Integer类型 | 0000 0000 0000 0000 0000 0000 0000 0001 |
2 Integer类型 | 0000 0000 0000 0000 0000 0000 0000 0010 |
3 Integer类型 | 0000 0000 0000 0000 0000 0000 0000 0011 |
. . . |
. . . |
Integer.MAX_VALUE | 0111 1111 1111 1111 1111 1111 1111 1111 |
近期评论