包装类
常见的类和对象
byte short int long
float double
char boolean
包装类
public class DataType {
public static void main(String[] args) {
/* TODO 包装类
Byte b = null;
Short s = null;
Integer i = null;
Long lon = null;
Float f = null;
Double d = null;
Character c = null;
Boolean bln = null;
*/
int i = 10;
//Integer integer = new Integer(i); 不推荐使用
//将基本数据类型转换为包装类
Integer i1 = Integer.valueOf(i);
//自动装箱
Integer i2 = i;
//自动拆箱
int i3 = i1.intValue();
int i4 = i;
}
}
标签:i1,包装,int,Integer,null,public
From: https://www.cnblogs.com/Ashen-/p/17020063.html