Integer中有个静态内部类 IntegerCache ,里面有个cache[],也就是Integer常量池 大小为一个字节(-128-127). (jdk1.8.0_101)源码 private static class IntegerCache { static final int low = -128; static final int high; static final Integer cache[]; static { // high value may be configure
public class IntegerExample { public static void main(String[] javalatte) { Integer i = 10; Integer j = new Integer(10); Integer k = 130; Integer p = new Integer(130); } } 将上面的类编译后再反编译得到如下的类: public class IntegerExample { public static void main(Stri