一.深入自动拆装箱 1.直接举例: public class D78_AutomaticUnpackingAndPacking{ public static void main(String[] args){ Integer i1 = new Integer(10); Integer i2 = new Integer(10); //这里不会自动进行拆箱 System.out.println(i1==i2);//false //比较两个Integer类型的数据是否相等,不能用“==" //Inte…
/ * int 仅仅是一个基本类型.int有对应的类类型,那就是Integer. * 为了对基本数据类型进行更多的操作,更方便的操作,Java就针对每一种基本数据类型提供了对应的类类型--包装类类型.各个基本类型分配封装与之对应的类类型来对基本类型数据更方便的操作. * byte Byte * short Short * int Integer(这个看起来比较特殊) * long Long * float Float * doubl…