Mr. Brewer's Java: Ch. 10 Review Questions
try saying the two class names together
A way to discover which of two classes is the base class and which is the subclass is to ___________.
as the first statement
If a superclass constructor requires arguments, any constructor of its subclasses must call the superclass constructor ___________.
must contain a constructor
If the only constructor in a superclass requires arguments, its subclass ___________.
extends
The Java keyword that creates inheritance is ___________.
static
Within a subclass, you cannot override ___________ methods.
either a or b
You call a static method using ___________. the name of its class, a dot, and the method name the name of the class's superclass, a dot, and the method name the name of an object in the same class, a dot, and the method name either a or b
parent class
The keyword super always refers to the ___________ of the class in which you use it.
cannot
When a parent class contains a static method, child classes ___________ override it.
overrides
When a subclass method has the same name and argument types as a superclass method, the subclass method ___________ the superclass method.
parent class
When you instantiate an object that is a member of a subclass, the ___________ constructor executes first.
Dog/Poodle
Which of the following choices is the best example of a parent class/child class relationship? Rose/Flower Present/Gift Dog/Poodle Sparrow/Bird
A child class inherits from a parent class.
Which of the following statements is true? A child class inherits from a parent class. A parent class inherits from a child class. Both above are true. Both above are false.
final
You use a ___________ method access specifier when you create methods for which you want to prevent overriding in extended classes.
superclass
A base class can also be called a ___________.
super("Suzuki");
A child class Motorcycle extends a parent class Vehicle. Each class constructor requires one String argument. The Motorcycle class constructor can call the Vehicle class constructor with the statement ___________.
modelHigh.getFloors();
A class named Building has a public, nonstatic method named getFloors(). If School is a child class of Building, and modelHigh is an object of type School, which of the following statements is valid? Building.getFloors(); School.getFloors(); modelHigh.getFloors(); All of the above are valid.
inline
A compiler can decide to ___________ a final method—that is, determine the code of the method call when the program is compiled.
many of the methods you need have already been used and tested
Employing inheritance reduces errors because ___________.
both a and b
If you create a data field or method that is ___________, it can be used within its own class or in any classes extended from that class. public protected private both a and b
information hiding
In Java, the concept of keeping data private is known as ___________.