Exam 10: Inheritance and Polymorphism

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

A class that is not intended to be instantiated but is to be used only as a base class is called a(n) ____________.

(Multiple Choice)
4.9/5
(39)

Which one of the following is a class header indicating that we are defining a class named Amphibian, which is derived from the Animal class?

(Multiple Choice)
4.9/5
(38)

When designing an object-oriented program, the best approach is to define a base class to hold all the general data about a group of similar objects, and then define derived classes for each specific type of object.

(True/False)
4.8/5
(41)

A class that is not abstract is sometimes called a(n) ____________.

(Multiple Choice)
4.9/5
(33)

New fields, properties, and methods cannot be added to a derived class unless these elements already existed in the base class.

(True/False)
4.8/5
(25)

If a reference to a base class object calls a method that has been overridden by a derived class, the derived class's version of the method is the one that executes.

(True/False)
4.7/5
(34)

To override a property in the __________ you write the override keyword in the property declaration.

(Multiple Choice)
4.8/5
(41)

In the real world you can find many objects that are specialized versions of more general objects.

(True/False)
4.8/5
(43)

The term ____________ refers to an object's ability to take different forms.

(Multiple Choice)
4.8/5
(45)

Which one of the following is a specialized version of a general food substance?

(Multiple Choice)
4.7/5
(37)

The ____________ declares that a derived class is allowed to override the current method in the base class.

(Multiple Choice)
4.9/5
(40)

A statement that tries to use the new operator instantiate an abstract class will not compile.

(True/False)
4.7/5
(24)

When an "is a" relationship exists between objects, it means that the specialized object has all of the characteristics of the general object, plus additional characteristics that make it unique.

(True/False)
4.9/5
(41)

A variable declared as a base class type can only be used to reference members declared in the ____________.

(Multiple Choice)
4.7/5
(39)

If a base class does not have a parameterless constructor, its derived class constructor must use the notation: base(parameterList) to call one of the base class's parameterized constructors.

(True/False)
4.8/5
(33)

Base classes are sometimes called superclasses, and derived classes are sometimes called ____________.

(Multiple Choice)
4.8/5
(37)

You cannot assign a base class reference to a derived class variable.

(True/False)
4.9/5
(44)
Showing 21 - 37 of 37
close modal

Filters

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