Java Reference
In-Depth Information
}
public void setHomeTeam(Team t)
{
home = t;
}
public void setVisitingTeam(Team visitor)
{
visitor = visitor;
}
}
5.
How many fields are in the Team class? Name them.
6.
How many fields are in the BaseballGame class? Name them.
7.
How many methods are in the Team class? Name them.
8.
How many methods are in the BaseballGame class? Name them.
9.
After the following statement, what is the value of each field of the game object?
BaseballGame game = new BaseballGame();
10.
After the following statement, what is the value of each field of the giants object?
Team giants = new Team();
Consider the following statements when answering questions 11 and 12:
Team angels;
BaseballGame worldSeries;
11.
How many objects are there in memory after the previous two statements are done
executing?
12.
Which consumes more memory: angels or worldSeries?
13.
How many Team objects are there in memory after the following two statements?
Team a = new Team();
Team b = a;
14.
In the previous question, how many Team references are there in memory after the
two statements execute?
15.
After some testing, it has been determined that the setVisitingTeam() method of the
BaseballGame class does not work successfully. After it is invoked, the visitor field
does not change. What is the problem, and how can it be fixed?
Search WWH ::




Custom Search