So I have an object TeamStats.
I would like to be able to sort a teamStats list by gamesWon however, when I try to implement the compareTo method as shown below, I am getting the error message: java: int cannot be dereferenced.
I cannot figure out why that is, as I am following this ArrayList sorting tutorial and they do not seem to have the same problem.
Why am I getting this error and how do I avoid it?
package sample;
import java.util.Comparator;
public class TeamStats implements Comparator<TeamStats>  {
    int teamID;
    int gamesPlayed;
    int gamesWon;
    int setsWon;
    public TeamStats(int teamID, int gamesPlayed, int gamesWon, int setsWon) {
        this.teamID = teamID;
        this.gamesPlayed = gamesPlayed;
        this.gamesWon = gamesWon;
        this.setsWon = setsWon;
    }
    public int getTeamID() {
        return teamID;
    }
    public void setTeamID(int teamID) {
        this.teamID = teamID;
    }
    public int getGamesPlayed() {
        return gamesPlayed;
    }
    public void setGamesPlayed(int gamesPlayed) {
        this.gamesPlayed = gamesPlayed;
    }
    public int getGamesWon() {
        return gamesWon;
    }
    public void setGamesWon(int gamesWon) {
        this.gamesWon = gamesWon;
    }
    public int getSetsWon() {
        return setsWon;
    }
    public void setSetsWon(int setsWon) {
        this.setsWon = setsWon;
    }
    @Override
    public int compare(TeamStats o1, TeamStats o2) {
        return o2.getGamesWon().compareTo(o1.getGamesWon());
    }
}