Exam 11: Inheritance and Composition

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

To ____ a public member function of a base class in the derived class, the corresponding function in the derived class must have the same name, number, and types of parameters.

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

A

C++ provides ____ functions as a means to implement polymorphism in an inheritance hierarchy, which allows the run-time selection of appropriate member functions.

Free
(Multiple Choice)
4.7/5
(43)
Correct Answer:
Verified

C

A derived class cannot directly access public members of a base class.

Free
(True/False)
4.7/5
(34)
Correct Answer:
Verified

False

In protected inheritance, public and protected members of the base class become the protected members of the derived class.

(True/False)
4.9/5
(33)

The new classes that we create from existing classes are called ____ classes.

(Multiple Choice)
4.8/5
(27)

The constructor of a derived class cannot directly access the ____________________ member variables of the base class.

(Short Answer)
4.8/5
(36)

Which of the following class definitions makes the public members of the class aClass become the public members of the class bClass?

(Multiple Choice)
4.8/5
(29)

Consider the following class definition: The class dClass is derived from the class bClass using the ____ type of inheritance. Consider the following class definition: The class dClass is derived from the class bClass using the ____ type of inheritance.

(Multiple Choice)
4.8/5
(37)

If inheritance is public, all protected members of the base class are ____________________ members of the derived class.

(Short Answer)
4.8/5
(40)

Which of the following statements about inheritance is true if memberAccessSpecifier is protected?

(Multiple Choice)
4.8/5
(33)

A call to the base class's constructor is specified in the heading of the definition of a derived class constructor.

(True/False)
4.9/5
(41)

If the derived class does not override a public member function of the base class, you may specify a call to that public member function by using the name of the function and the appropriate parameter list.

(True/False)
4.9/5
(33)

The constructors of a derived class can (directly) initialize only the (public data) members inherited from the base class of the derived class.

(True/False)
4.9/5
(38)

The private members of a base class can be directly accessed by a derived class.

(True/False)
4.8/5
(39)

Which of the following is true about a derived class?

(Multiple Choice)
4.9/5
(41)

C++ provides ____________________ functions as a means to implement polymorphism in an inheritance hierarchy.

(Short Answer)
4.8/5
(37)

If the corresponding functions in the base class and the derived class have the same name but different sets of parameters, then this function is ____ in the derived class.

(Multiple Choice)
4.8/5
(40)

Consider the following class definitions: Which of the following dClass constructor definitions is valid in C++? Consider the following class definitions: Which of the following dClass constructor definitions is valid in C++?

(Multiple Choice)
4.9/5
(33)

Which of the following is a valid definition of the derived class bClass?

(Multiple Choice)
5.0/5
(46)

Consider the following class definitions: Consider the following class definitions:   Which of the following statements correctly redefines the member function print of bClass? Which of the following statements correctly redefines the member function print of bClass?

(Multiple Choice)
4.8/5
(36)
Showing 1 - 20 of 41
close modal

Filters

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