Polymorphism and Interfaces Quiz Answers and Explanations, Quizzes of Data Structures and Algorithms

The answers and explanations for a quiz on polymorphism and interfaces in object-oriented programming. Topics covered include the concept of polymorphism, interfaces, superclass references, abstract classes, the 'instanceof' keyword, final methods, and the use of interfaces to declare constants and share common methods.

Typology: Quizzes

Pre 2010

Uploaded on 08/01/2009

koofers-user-c58
koofers-user-c58 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Polymorphism quiz
1. Polymorphism:
-Enables “programming in the general”;
-The same invocation can produce “
many forms” of results;
a. TRue
2. Interfaces:
Implemented by classes to assign common functionality to possibly unrelated classes.
a. True
3. A superclass reference can not be aimed at a subclass object
a. False
4. Abstract classes is used only as abstract superclasses for concrete subclasses and to
declare reference variables
5. instanceof Determines whether an object is an
instance of a certain type
6. getClass method returns name of class
a. FALSE
7. final methods: Can be overridden in a subclass;
a. FAlse
8. Interfaces is used typically when disparate classes need to share common methods and
constants;
a. TRUE
9. A class can implement only one interface
a. FAlse
10. Interfaces can be used to declare constants used in many class declarations
a. TRUE
11.

Partial preview of the text

Download Polymorphism and Interfaces Quiz Answers and Explanations and more Quizzes Data Structures and Algorithms in PDF only on Docsity!

Polymorphism quiz

  1. Polymorphism: -Enables “programming in the general”; -The same invocation can produce “ many forms” of results; a. TRue
  2. Interfaces: Implemented by classes to assign common functionality to possibly unrelated classes. a. True
  3. A superclass reference can not be aimed at a subclass object a. False
  4. Abstract classes is used only as abstract superclasses for concrete subclasses and to declare reference variables
  5. instanceof Determines whether an object is an instance of a certain type
  6. getClass method returns name of class a. FALSE
  7. final methods: Can be overridden in a subclass; a. FAlse
  8. Interfaces is used typically when disparate classes need to share common methods and constants; a. TRUE
  9. A class can implement only one interface a. FAlse
  10. Interfaces can be used to declare constants used in many class declarations a. TRUE