自动装箱与自动拆箱——JavaSE基础

自动装箱与自动拆箱

自动装箱与拆箱就是编译器蜜糖(Compiler Sugar)

Integer a = 234; // 自动装箱,实际上是Integer a = Integer.valueOF(234);
int b = a; // 自动拆箱,实际上是int b = a.intValue();
posted @ 2021-06-28 11:40  HelliWrold1  阅读(40)  评论(0编辑  收藏  举报