1.将基本类型值转换为包装类对象的过程叫做装箱,反之叫开箱。
常见的包装类:
such:
自动装箱:int t1=10; Integer t2=t1;
手动装箱: Integer t4=new Integer(t1);
自动拆箱: int t3=t2;
手动拆箱:int t5=t4.intvalue();
2.字符串与包装类转换
1.将基本类型值转换为包装类对象的过程叫做装箱,反之叫开箱。
常见的包装类:
such:
自动装箱:int t1=10; Integer t2=t1;
手动装箱: Integer t4=new Integer(t1);
自动拆箱: int t3=t2;
手动拆箱:int t5=t4.intvalue();
2.字符串与包装类转换