Exam 10: Object-Oriented Programming: Polymorphism

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Consider classes A, B and C, where A is an abstract superclass, B is a concrete class that inherits from A and C is a concrete class that inherits from B. Class A declares abstract method originalMethod, implemented in class B. Which of the following statements is true of class C?

Free
(Multiple Choice)
4.8/5
(37)
Correct Answer:
Verified

D

A class that implements an interface but does not declare all of the interface's methods must be declared ________.

Free
(Multiple Choice)
4.9/5
(41)
Correct Answer:
Verified

C

Non-abstract classes are called ________.

Free
(Multiple Choice)
4.8/5
(35)
Correct Answer:
Verified

D

Which of the following does not complete the sentence correctly? An interface .

(Multiple Choice)
4.7/5
(36)

Which statement best describes the relationship between superclass and subclass types?

(Multiple Choice)
4.8/5
(35)

Which of the following statements is false?

(Multiple Choice)
4.9/5
(26)

Which of the following could be used to declare abstract method method1 in abstract class Class1 (method1 returns an int and takes no arguments)?

(Multiple Choice)
4.8/5
(37)

Which of the following is not possible?

(Multiple Choice)
4.9/5
(40)

Declaring a method final means:

(Multiple Choice)
4.8/5
(35)

For which of the following would polymorphism not provide a clean solution?

(Multiple Choice)
4.7/5
(36)

Polymorphism allows for specifics to be dealt with during:

(Multiple Choice)
4.8/5
(28)

The UML distinguishes an interface from other classes by placing the word "interface" in above the interface name.

(Multiple Choice)
4.8/5
(35)

Which of the following statements about abstract superclasses is true?

(Multiple Choice)
4.9/5
(30)

Consider the abstract superclass below: Public abstract class Foo { Private int a; Public int b; Public Foo(int aVal, int bVal) { A = aVal; B = bVal; } Public abstract int calculate(); } Any concrete subclass that extends class Foo:

(Multiple Choice)
4.9/5
(39)

Interfaces can have methods.

(Multiple Choice)
4.9/5
(34)

Which keyword is used to specify that a class will define the methods of an interface?

(Multiple Choice)
4.9/5
(24)

When a superclass variable refers to a subclass object and a method is called on that object, the proper implementation is determined at execution time. What is the process of determining the correct method to call?

(Multiple Choice)
4.9/5
(32)

If the superclass contains only abstract method declarations, the superclass is used for ________.

(Multiple Choice)
4.7/5
(40)

Assigning a subclass reference to a superclass variable is safe ________.

(Multiple Choice)
4.9/5
(38)

It is a UML convention to denote the name of an abstract class in ________.

(Multiple Choice)
4.8/5
(37)
Showing 1 - 20 of 30
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)