类型间的转换:(基本数据类型、包装类、String) 代码演示自动装箱和自动拆箱: public void test3(){ //自动装箱:基本数据类型 --->包装类 int num2 = 10; Integer in1 = num2;//自动装箱 boolean b1 = true; Boolean b2 = b1;//自动装箱 //自动拆箱:包装类--->基本数据类型 System.out.println(in1.toString()); int num3 = in1;//自动拆箱 }