Integer的自动拆箱装箱解析
- IntegerCache
- 自动拆箱与装箱
-
- 自动装箱
- 自动拆箱
- 基本类与封装类
IntegerCache
IntegerCache是Integer类中的静态内部类,用于缓存数据便于节省内存、提高性能。下面给出IntegerCache的源码:
/**
* Cache to support the object identity semantics of autoboxing for values between
* -128 and 127 (inclusive) as required by JLS.
*
* The cache is initialized on first usage. The size of the cache
* may be controlled by the {@code -XX:AutoBoxCacheMax=<size>} option.
* During VM initialization, java.lang.Integer.IntegerCache.high property
* may be set and saved in the private system properties in the
* sun.misc.VM class.
*/
最后
以上就是温柔台灯最近收集整理的关于从源码分析Integer缓存机制IntegerCache和自动拆箱装箱解析IntegerCache的全部内容,更多相关从源码分析Integer缓存机制IntegerCache和自动拆箱装箱解析IntegerCache内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复