Chapter Questions
The statementCar car;allocates space in memory for an object. (T / F)
What does the new operator do?
Assigning one reference variable to another copies the right-side object's instance variables into the left-side object's instance variables. (T / F)
What is a memory leak?
Consider this code fragment:boolean same;\[\begin{array}{l}\text { Car } \operatorname{car} X=\text { new } \operatorname{Car}() ; \\\text { Car } \operatorname{car} Y=\operatorname{car} X \\\text { same }=(\operatorname{car} X==\operatorname{car} Y)\end{array}\] What is the final value of same?
What is the return type of an equals method?
By convention, we use the name equals for methods that perform a certain kind of evaluation. What is the difference between the evaluation performed by an equals method and the $==$ operator?
When you pass a reference to a method, you enable the method to modify the referenced object. (T / F)
What two things must be included in a method definition so that it may be called as part of a method call-chaining statement?
What is it called when you have two or more methods with the same name in the same class?
If you want the current object to call a different method in the same class as the current class, the method call is easy-just call the method directly, with no reference variable dot prefix. (T / F)
What is the return type of a constructor?
The name of a constructor must be exactly the same as the name of its class. (T / F)
Standard coding conventions suggest that you put constructor definitions after the definitions of all methods. (T / F)
If a class's source code contains a single one-parameter constructor, the constructor is overloaded because this one-parameter constructor has the same name as the default zero-parameter constructor. $(\mathrm{T} / \mathrm{F})$
Suppose you have a class with two constructors. What are the rules for calling one constructor from the other constructor?
You can partition a large problem into many smaller problems by using many driven classes. (T / F)
How do you give a component object a reference to its container or another component in the same container?
What do you do to make one object logically contain another object?