Object a=1;
Object b="1";
System.out.println(a==b);
System.out.println(a.equals(b));
结果为:
false
false
如何让结果为true
Object a=1;
Object b="1";
System.out.println(a==b);
System.out.println(a.equals(b));
结果为:
false
false
如何让结果为true
System.out.println(a.toString().equals(b));