JAVA 3252 Chapter 11 polymorphism
Questions with Detailed Verified Answers
(100% Correct Answers) /Already Graded
A+
Polymorphism enables you to:
A. program in the general.
B. program in the specific.
C. absorb attributes and behavior from previous classes.
D. hide information from the user.
Ans: A. program in the general.
Which of the following statements about interfaces is false?
A. An interface describes a set of methods that can be called on an object, providing a
default implementation for the methods.
B. An interface describes a set of methods that can be called on an object, not providing
concrete implementation for the methods.
C. Interfaces are useful when attempting to assign common functionality to possibly unrelated
classes.
D. Once a class implements an interface, all objects of that class have an is-a relationship with
the interface type
Ans: A. An interface describes a set of methods that can be called on an object, providing a
default implementation for the methods.
For which of the following would polymorphism not provide a clean solution?
A. A billing program where there is a variety of client types that are billed with different fee
structures.
B. A maintenance log program where data for a variety of types of machines is collected and
maintenance schedules are produced for each machine based on the data collected.
, Page |2
C. A program to compute a 5% savings account interest for a variety of clients.
D. An IRS program that maintains information on a variety of taxpayers and determines who
to audit based on criteria for classes of taxpayers.
Ans: C. A program to compute a 5% savings account interest for a variety of clients
Polymorphism allows for specifics to be dealt with during:
A. execution.
B. compilation.
C. programming.
D. debugging.
Ans: A. execution.
Which statement best describes the relationship between superclass and subclass types?
A. A subclass reference cannot be assigned to a superclass variable and a superclass
reference cannot be assigned to a subclass variable.
B. A subclass reference can be assigned to a superclass variable and a superclass reference
can be assigned to a subclass variable.
C. A superclass reference can be assigned to a subclass variable, but a subclass reference
cannot be assigned to a superclass variable.
D. A subclass reference can be assigned to a superclass variable, but a superclass reference
cannot be assigned to a subclass variable.
Ans: D. A subclass reference can be assigned to a superclass variable, but a superclass
reference cannot be assigned to a subclass variable.
A(n)_________class cannot be instantiated.
A. final.
B. concrete.
C. abstract.
D. polymorphic.
Ans: abstract
Non-abstract classes are called:
Ans: concrete
It is a UML convention to denote the name of an abstract class in:
A. bold.