1.背景
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[130] = 1;
array[131] = 1;
Integer a = 1;
if (a.equals(1) && a.equals(2) && a.equals(3)) {
System.out.println("true");
}
}
输出:true
2.为什么呢
debug一下:看图,瞬间明白了
完美!