java的Integer中也会有缓存
作者:互联网
https://blog.csdn.net/suifengyongyuan/article/details/124356203
默认缓存了 [-128 ~ 127]
Integer m = new Integer(1);
Integer n = new Integer(1);
m==n //false 因为new时 生成不同引用地址
Integer m = 1; Integer n = 1; m==n //true 默认缓存了 [-128 ~ 127] Integer m = 128; Integer n = 128; m==n //false
标签:缓存,false,java,127,new,128,Integer 来源: https://www.cnblogs.com/jimz/p/16579409.html