public class TestInteger {

public static void main(String[] args) throws NoSuchFieldException,IllegalAccessException {
    Class cache = Integer.class.getDeclaredClasses()[0];//1
    Field myCache = cache.getDeclaredField("cache");//2
    myCache.setAccessible(true);//3
    Integer[] newCache = (Integer[]) myCache.get(cache);//4
    newCache[132] = newCache[133];//5
    int a = 2;
    int b = a+a ;
    System.out.printf("%d+%d=%d",a,a,b);
}

}


彪悍大蓝猫
67 声望3 粉丝

代码搬运工