12.1 Fill in the blanks in each of the following statements:
If a class contains at least one abstract method, it must be declared as a(n) class.
Classes from which objects can be instantiated are called classes.
involves using a base-class variable to invoke methods on base-class and derived-class objects, enabling you to “program in the general.”
Methods in a class that do not provide implementations must be declared using keyword .
Casting a reference stored in a base-class variable to a derived-class type is called .
12.2 State whether each of the statements that follows is true or false. If false, explain why.
It’s possible to treat base-class objects and derived-class objects similarly.
All methods in an abstract
class must be declared as abstract
methods.
Attempting to invoke a derived-class-only method through a base-class variable is an error.
If a base class declares an abstract
method, a derived class must implement that method.
An object of a class that implements an interface may be thought of as an object of that interface type.