转载自:http://blog.csdn.net/qq_35101189/article/details/54021473
Java的数据类型以及大小
基本数据类型
- byte、boolean、char、short、int、long、float、double
- 整型:byte(8 bit), short(2 byte), int(4 byte), long(8 byte),浮点数类型:float(4 byte,直接赋值需要加 f 或 F ), double(8 byte)
- 字符类型:char(2 byte, unicode码,用单引号赋值)
- 布尔类型:boolean( 4 or 1 byte)