Primitive data types:
boolean | Not Applicable | true of false |
char | 16bit | 0~(2^16)-1 |
byte | 8bit | -(2^7)~(2^7)-1 |
short | 16bit | -(2^15)~(2^15)-1 |
int | 32bit | -(2^31)~(2^31)-1 |
long | 64bit | -(2^63)~(2^63)-1 |
float | 32bit | |
double | 64bit |
4种整型:byte,short,int,long,默认int.
2种浮点型:float,double,默认double.
Example:
float f = 1.0; //wrong,1.0默认为double类型.
float f = 1.0f; //right
引用类型:
类,接口,数组,枚举,标注