数据类型
数据类型的分类
引用数据类型(除基本数据类型之外的,如String等)
基本数据类型
四大类八种
整数
byte short int long
浮点数
float double
字符
char
布尔
boolean
Java基本数据类型及其封装类
|
基本类型 |
大小(字节) |
默认值 |
封装类 |
|
byte |
1 |
(byte) 0 |
Byte |
|
short |
2 |
(short) 0 |
Short |
|
int |
4 |
0 |
Integer |
|
long |
8 |
0L |
Long |
|
float |
4 |
0.0f |
Float |
|
boolean |
false |
Bollean |
|
|
double |
8 |
0.0d |
Double |
|
char |
2 |
\u0000 (null) |
Char |