public class Main {
public static void main(String[] args) throws Exception {
Class cache = Integer.class.getDeclaredClasses()[0];
Field c = cache.getDeclaredField("cache");
c.setAccessible(true);
Integer[] array = (Integer[]) c.get(cache);
array[132] = array[133];
System.out.printf("%d", 2 + 2 );
<span style="white-space:pre"> </span>System.out.println();
System.out.println( array[132] = array[133] );
}
}
刚刚看到就贴上来了,介于我浅薄的知识尚未能完全明白 array[132] = array[133]; 之后为啥 System.out.printf("%d", 2 + 2 ); 就能成5 ,大家有兴趣的自己测试看看哈。