We have constructed a Player Class for you. Add the following: public static variable: int totalPlayers Static variable should be an int. The value should be incremented whenever a new Player is constructed. public static variable: int maxPlayers Static variable should be an int. Set its value to 10. public static method: gameFull() The gameFull() static method should return a boolean of whether the total players is greater than or equal to the maxPlayers static variable.

Respuesta :

Answer:

public class Player {

   public static int totalPlayers = 0;

   public static int maxPlayers = 10;  

   public static boolean gameFull() {

       return totalPlayers >= maxPlayers;

   }

   public Player() {         // Player class constructor

       totalPlayers++;

   }

}

Explanation:

The Java program defines the class Player which has two public class variables and a public method. The class constructor increases the totalPlayer variable by one for every player object created.