Click to reopen instructions.

In Point and Color you wrote one class at a time. Real programs are made of many classes that refer to each other, so this time you’ll write two: a Player and a Team. A Player knows which Team they are on and a Team keeps a list of its Players, which means the two classes have to work together to keep their stories straight: when a Team adds a Player, that player’s idea of which team they’re on has to change too.

There are two files, Team.java and Player.java, one per class. (In Java each public class goes in a file of its own, named after the class.) The two files are compiled together so code in either one can use the other class. The tests are labeled with which class they are about. The suggested order is roughly top to bottom, but the two classes depend on each other, so you will go back and forth.

Put definitions here.

Revisions:

Test results show up here.

Errors