How could I assign a name to 5 different characters of a game in order to have their name pop up when the reach the finish line?


1 2 3 4 5 6 | private String name; public Racer(String racerName) { name = racerName; } |
1 2 3 4 5 6 7 | public class RacerOne extends Racer { public RacerOne() { name = "Racer One" ; } } |
1 | String name = winner.getClass().getName(); |