Question: Write a class encapsulating a board game,which inherits from Game. A board game has the following additional attributes: the minimun number of players, the maximum
Write a class encapsulating a board game,which inherits from Game. A board game has the following additional attributes: the minimun number of players, the maximum number of players, and whether there is a time limit to finish the game. Code the constructor and the tostring( ) method of the new class. You also need to include a client class to test your code.
public class Game { private String description; public Game( String newDescription ) { setDescription( newDescription ); } public String getDescription( ) { return description; } public void setDescription( String newDescription ) { description = newDescription; } public String toString( ) { return ( " description: " + description ); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
