一条基础题目,还是不太懂底层的东西public static void main(String[] args) {Long lo new Long(1)Inte
一条基础题目,还是不太懂底层的东西
public static void main(String[] args) { Long lo = new Long(1); Integer a = new Integer(1); int aa = 1; System.out.println(lo.equals(a)); //false System.out.println(lo==aa); //true System.out.println(lo==a); //编译错误 }
public static void main(String[] args) { Long lo = new Long(1L); Integer a = new Integer(1); int aa = 1; System.out.println(lo.equals(a)); System.out.println(lo.longValue() == aa); }