收起
所有类默认继承Object类。Object中的equals方法是这样的:
public boolean equals(Object obj) { return (this == obj); }
比较的是2个对象的地址。和hashCode没有关系。所以你要重写的是equals
报告相同问题?