==
当两个引用变量引用具有相同哈希码值的同一个对象时,返回 false背后的逻辑是什么?
public class One {
public static void main(String[] args) {
One o = new One();
One o1 = o;
System.out.println(o.toString());
System.out.println(o1.toString());
System.out.println(o.hashCode());
System.out.println(o1.hashCode());
// Why does it print false ?
System.out.println(o.toString()==o1.toString()); // false
System.out.println(o.hashCode()==o1.hashCode()); // true
System.out.println(o.equals(o1)); // true
System.out.println(o.toString().hashCode()==o.toString().hashCode()); // true
}
}