class V{
}
public class T1 {
public static void main(String[] args) {
V v = new V();
V v1 = new V();
System.out.println(v.equals(v1));
}}
为什么输出是false
class V{
}
public class T1 {
public static void main(String[] args) {
V v = new V();
V v1 = new V();
System.out.println(v.equals(v1));
}}
为什么输出是false
两个对象,引用地址不同,当然false
除非你重写V的equals