我怀疑在java中跟随代码对象引用。 这是代码。
public class Simple{
public static void main(String args[]){
Integer a=150,b=150;
System.out.println(a==b);
Integer c=100,d=100;
System.out.println(c==d);
}}
我可以在在线编译器中编译并执行上面的代码,我得到了答案 false true 。我的疑问是为什么我不能得到第二个是假的?它也是对象参考不是吗?请有人帮我澄清疑问。谢谢提前