1.基本类型转化为Integer,创建包装类对象
(1)包装类 对象=new 包装类(基本数据/String);
(2)包装类 对象=包装类.valueOf(基本数据/String);
eg: Integer intc=Integer.valueOf(“100”);
2.包装类转换为基本数据
int a=intc.intValue();
3.String转化为基本数据类型
int a=Integer.parseInt(“123”);
1.基本类型转化为Integer,创建包装类对象
(1)包装类 对象=new 包装类(基本数据/String);
(2)包装类 对象=包装类.valueOf(基本数据/String);
eg: Integer intc=Integer.valueOf(“100”);
2.包装类转换为基本数据
int a=intc.intValue();
3.String转化为基本数据类型
int a=Integer.parseInt(“123”);