整型
1个字节占8位
1 byte 1字节 -128~127
2 short 2字节 -32768~32767
3 int 4字节 正负20亿多一点 用的最多
4 long 8字节 特别大,当int不够用的时候,才会用long
字符型
5 char
占用2个字节,采用的是Unicode编码格式,支持中文
浮点型
6 float 4字节 单精度
7 double 8字节 双精度 用的最多
布尔型
8 boolean
true 真
false 假
1个字节占8位
1 byte 1字节 -128~127
2 short 2字节 -32768~32767
3 int 4字节 正负20亿多一点 用的最多
4 long 8字节 特别大,当int不够用的时候,才会用long
字符型
5 char
占用2个字节,采用的是Unicode编码格式,支持中文
浮点型
6 float 4字节 单精度
7 double 8字节 双精度 用的最多
布尔型
8 boolean
true 真
false 假