基本数据类型 数据类型名占用内存空间 数值范围 缺省值说明 byte 1字节c128)-127 short 2字节(-32768)~32767 int 4字节 (-2147483648)~2147483647 0000 整 (-9223372036854775808) long 8字节 ~9223372036854775807 float 4字节 0.0F double 8字节 0.0D 浮点型 char 2字节 字符型 boolean true或 false false布尔型基本数据类型 数据类型名 占用内存空间 数值范围 缺省值 说明 byte 1字节 (-128)~127 0 整 型 short 2字节 (-32768)~32767 0 int 4字节 (-2147483648)~2147483647 0 long 8字节 (-9223372036854775808) ~9223372036854775807 0 float 4字节 0.0F 浮 点 double 8字节 0.0D 型 char 2字节 字符型 boolean —— true或false false 布尔型