public abstract AbstractGameStats<A extends GameStats> {
public abstract A addGameSpecificStats(final A gameStats, final LiveStats liveStats);
}
public abstract class LiveStats { // }
public class FootballStats extends LiveStats { // }
public class FootballLiveGameStats extends AbstractGameStats<FootballGameStats> {
@Override
public FootballGameStats addGameSpecificStats(final FootballGameStats gameStats, final FootballStats footballStats) {}
}
Doing this tells me im not overriding the parent method because in addSpecificGameStats, im passing in the subclass of FootballStats rather than the LiveStats parent class. I dont understand what the problem is here. Why cant i just pass in the base type? Isnt this the whole point of polymorphism?