Chapter Questions
If you want a class you define to inherit methods from the Object class, you must append the suffix, extends Object, to your class's heading. (T / F)
When used to compare reference variables, the $==$ operator works the same as the Object class's equals method. (T / F)
What does the equals method defined in the String class compare?
What is returned by the object class's tostring method?
What's wrong with replacing the println statement in Figure 13.2 's main method with these two statements? String description $=$ car.tostring () ;System .out.println (description);
The return type of an overriding method must be the same as the return type of the overridden method. $(\mathrm{T} / \mathrm{F})$
In Java, polymorphic method calls are bound to method definitions at compile time (not runtime). (T / F)
Assume one reference variable's class is descended from another reference variable's class. To be able to assign one reference variable to the other one (without using a cast operator), the left-side variable's class must be a(n) ___________________________ of the right-side reference variableās class.
A given array may contain elements of varying type. (T / $\mathrm{F}$ )
What are the syntax features of an abstract method?
Any class that contains an abstract method must be declared to be an abstract class. (T / F)
You cannot instantiate an abstract class. (T / F)
You can use an interface to provide direct access to a common set of constants from many different classes. $(\mathrm{T} / \mathrm{F})$
You can declare reference variables to have an interface type and use them just like you would use reference variables declared to be the type of a class in an inheritance hierarchy. (T / F)
Describe the access provided by the protected modifier.
It's illegal to use private for any method that overrides an abstract method. (T/F)