Question: You created a class named Game that included two Team objects that held data about teams participating in a game. Modify the Game class to

You created a class named Game that included two Team objects that held data about teams participating in a game. Modify the Game class to set the game time to the message Game cancelled! if the two teams in a game do not have the same value for the sport. (In other words, a girls’ basketball team should not have a game  cheduled with a boys’ tennis team.) Save the revised class as Game.java. Write a program to demonstrate a valid and an invalid game.

Step by Step Solution

3.37 Rating (169 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

public class TestGame2 public static void mainString args Team team1 new TeamRoosevelt High Girls Ba... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming Questions!