Answer:
Check the explanation
Step-by-step explanation:
BaseballGame:
public class BaseballGame {
protected String[] names = new String[2];
protected int[][] scores;
protected int innings;
public BaseballGame() {
innings = 9;
scores = new int[2][9];
for(int i = 0; i < 9; i++)
scores[1][i] = scores[0][i] = -1;
}
public String getName(int team) {
return names[team];
}
public void setNames(int team, String name) {
names[team] = name;
}
public int getScore(int team, int inning) throws Exception
public void setScores(int team, int inning, int score) throws Exception
if(team < 0
}
HighSchoolBaseballGame:
public class HighSchoolBaseballGame extends BaseballGame {
public HighSchoolBaseballGame() {
innings = 7;
scores = new int[2][7];
for(int i = 0; i < 7; i++)
scores[1][i] = scores[0][i] = -1;
}
}
LittleLeagueBaseballGame:
public class LittleLeagueBaseballGame extends BaseballGame {
public LittleLeagueBaseballGame() {
innings = 6;
scores = new int[2][6];
for(int i = 0; i < 6; i++)
scores[1][i] = scores[0][i] = -1;
}
}