整型:byte short int long
浮点型:float double
字符型:char
布尔型:boolean
一个字节=8位
boolean=1位
byte=8位
short=16位
char=16位,两个字节
int=32位
long=64位
float=32位
double=64位
System.out.println(Byte.SIZE); //8
System.out.println(Byte.MAX_VALUE);//127
System.out.println(Byte.MIN_VALUE);//-128
System.out.println(Character.SIZE);//16
System.out.println(Short.SIZE);//16
System.out.println(Integer.SIZE);//32
System.out.println(Long.SIZE);
。。。
基本数据类型保存在栈中,存取速度高于其包装类所在的堆中、Java5.0之后,JVM可以完成基本数据类型和包装类之间的自动装换。