show goals > num

This commit is contained in:
Cool Guy
2026-05-01 20:22:45 +00:00
parent d2b35cbe05
commit d7d70a8968

View File

@@ -39,6 +39,16 @@ public class PlayerList {
return null;
}
public PlayerList getPlayersGoalsAbove(int num) {
PlayerList newList = new PlayerList();
for (HockeyPlayer p : PlayerList) {
if (p.getGoals() > num) {
newList.addPlayer(p);
}
}
return newList;
}
public void sortByNames() {
for (int i = 0; i < pList.size(); i++) {
boolean swapped = false;