/** * Compares whether the values of two Football objects are equal * * @return true if same team (false if different teams) */ public boolean equals(Object o) { if (!(o instanceof Football)) { return false; } else { Football other = (Football) o; return (other.getTeamName() == this.getTeamName() && other.getNumTitles() == this.getNumTitles()); } }
public static void main(String[] args) { System.out.println(Weather.getMinDifference()); System.out.println(Football.getMinDifference()); }