Integer及int面试题

https://blog.csdn.net/xiaojin21cen/article/details/79832173

创建Integer类型对象时,不使用new时,-128到127之间会在缓存里创建,超过此范围则new。缓存中的只会创建一次。

int和integer比较时会自动拆箱为int比较

猜你喜欢

转载自www.cnblogs.com/jianmianruxin/p/10472971.html