java核心基础--jdk源码分析学习--Integer

来源:互联网 发布:软件测试网站大全 编辑:程序博客网 时间:2024/06/05 08:16

java.lang.Integer

1. final类

public final class Integer

2. 内部value存储值

private final int value;

3. hashCode返回自身的value值

4. 内部类IntegerCache

加速自动装箱(调用valueOf())
默认范围-128 and 127
-XX:AutoBoxCacheMax=可设置IntegerCache的最大值(IntegerCache.high)

5. 常用方法

parseInt() 可进行2-36任意进制转换(见源码)
max()
min()

原创粉丝点击