package d1;
public class o7 {
public static void main(String[] args) {
Integer ing = new Integer(6);
System.out.println("int-->包装类"+ing);
int it = ing;
System.out.println("包装类-->int"+it);
int int1 = 12;
String int2 = Integer.toString(int1);
System.out.println("int-->string:"+int2);
int int3 = Integer.parseInt(int2);
System.out.println("string-->int:"+int3);
String st = new String("我是string包装类");
System.out.println("string-->包装类:"+st);
String str = st;
System.out.println("包装类->String:"+str);
}
}
基本数据类型、包装类、字符串String三者之间的相互转换
![](https://img-home.csdnimg.cn/images/20240711042549.png)