public class BaseballTeam { private String city, mascot; private int numberOfPlayers; @Override public boolean equals(Object obj) { if ( !(obj instanceof BaseballTeam)) return false; BaseballTeam other = (BaseballTeam) obj; return (city.equals(other.city) && mascot.equals(other.mascot)); } @Override public int hashCode() { return numberOfPlayers; } }

Respuesta :

Complete Question:

The Complete Question is on the image uploaded below:

Answer:

The answer is

C. The class compiles but has an improper hashCode() method.

Explanation:

The complete explanation for the answer above is shown on the first and second uploaded image

Ver imagen okpalawalter8
Ver imagen okpalawalter8
Ver imagen okpalawalter8
ACCESS MORE