Exam 10: Inheritance and Polymorphism

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

In the scenario described in the accompanying figure, what will the first statement do?

(Multiple Choice)
4.8/5
(35)

Composition is a "has-a" relationship.

(True/False)
4.8/5
(40)

To override a public method of a superclass in a subclass, the corresponding method in the subclass must have the same name but a different number of parameters.

(True/False)
4.8/5
(32)

The private members of a superclass can be accessed by a subclass.

(True/False)
4.9/5
(36)

Any new class you create from an existing class is called a(n) ____.

(Multiple Choice)
4.7/5
(35)

You must always use the reserved word super to use a method from the superclass in the subclass.

(True/False)
4.8/5
(45)

If a class is declared final, then no other class can be derived from this class.

(True/False)
4.8/5
(26)

What is the correct syntax for defining a new class Parakeet based on the superclass Bird?

(Multiple Choice)
4.9/5
(41)

In multiple inheritance, the subclass is derived from more than one superclass.

(True/False)
4.7/5
(34)

  -The method toString() is a public member of the class ____. -The method toString() is a public member of the class ____.

(Multiple Choice)
5.0/5
(40)
Showing 41 - 50 of 50
close modal

Filters

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