我需要为团队类编写一个equals()方法,该方法与提供的hashCode()方法一致
hashCode()方法:
public int hashCode()
{
return this.getPro().hashCode()
+ this.getTeam().hashCode();
}
我的equals方法不起作用
public boolean equals(Object obj)
{
ClassName pro = (ClassName) obj;
return (this.getPro().hashCode() == pro.getPro());
(this.getTeam().hashCode() == pro.getTeam());
}
任何帮助都会很好