RT 下面代码的结果是 false true想问下是为什么,equals()方法到底比较的是内存中的什么?
public class tryit {
public static void main(String[] args) {
Value v1=new Value(100);
Value v2=new Value(100);
System.out.println(v1.equals(v2));
Integer i1=new Integer(100);
Integer i2=new Integer(100);
System.out.println(i1.equals(i2));
}}
class Value{public Value(int a){i=a;} int i;}
叮当猫咪
慕村9548890