數據大小與類型

数据类型 大小(bit) 范围 默认值 包装类
byte (字节) 8 -128 - 127 0 Byte
short (短整型) 16 -32768 - 32767 0 Boolean
int (整型) 32 -2147483648-2147483647 0 Short
long (长整型) 64 -9233372036854477808-9233372036854477807 0 Character
float (浮点型) 32 -3.40292347 E+38-3.40292347 E+38 0.0 f Integer
double (双精度) 64 -1.79769313486231570 E+308-1.79769313486231570 E+308 0.0 d Long
char (字符型) 16 ‘ \u 0000 - u\ffff ’ ‘\u 0000 ’ Float
boolean (布尔型) 1 true/false false Double

基本數據vs引用數據

基本數據:
數值型:byte.short.int.long
浮點數型:float.double
字符:char
布爾:boolean
引用數據:
Interface
Array