I need to write an equals() method for the teams class that is consistent with the provided hashcode method
HashCode method
public int hashCode()
{
return this.getPro().hashCode()
+ this.getTeam().hashCode();
}
My equals method, but wont work
public boolean equals(Object obj)
{
ClassName pro = (ClassName) obj;
return (this.getPro().hashCode() == pro.getPro());
(this.getTeam().hashCode() == pro.getTeam());
}
Any help would be good