比较好的网站开发中小企业网络推广
一、包装类
Java针对八种基本数据类型定义了相应的引用类型:包装类(封装类)。
二、基本数据类型与包装类的基本转换
public class WrapperTest {public static void main(String[] args) {//基本数据类型转换为包装类Boolean aBoolean = new Boolean(false);//推荐使用Boolean aFalse = Boolean.valueOf("true");System.out.println(aFalse);//包装类转换为基本数据类型Integer integer = Integer.valueOf(10);int i = integer.intValue();System.out.println(i);}
}
三、自动装箱与拆箱
//装箱int a = 10;Integer b = a;//拆箱Boolean bn = false;boolean b1 = bn;