JAVA共有8中基本数据类型:
(1) 数值型
(a) 整数型:byte(1字节)、short(2字节)、int(4字节)、long(8字节);其中,long在赋值时,数值后加上l或者L 一般用int;
(b) 浮点型:float(4字节) 7位有效数字,赋值时,数值后加上f或者F、double(8字节)精度是float的2倍; 一般用double;
(2) 字符型:char(1字节)
(3) 布尔型:boolean只能取 true或者false;
原文:https://www.cnblogs.com/xhvb163/p/14181702.html