自动装箱和自动拆箱
public class BoxTest
{
public static void main(String[] args)
{
int a = 3;
Collection<Integer> c = new ArrayList<Integer>();
c.add(3);//将int类型的3转换为Integer类型并放到集合当中
c.add(a + 3);
for(Integer i : c)
{
System.out.println(i);//自动拆箱
}
}
}