Exam 10: Understanding Inheritance

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

Any child class function with the same name and argument list as the parent ____ the parent function.

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

D

What happens if a derived class uses the protected access specifier for inheritance?

Free
(Essay)
4.8/5
(40)
Correct Answer:
Verified

If a derived class uses the protected access specifier for inheritance, then the following statements are true:
- Base class members that are public become protected in the derived class.
- Base class members that are protected remain protected in the derived class.
- Base class members that are private are inaccessible in the derived class.,

If a base class contains a function that the derived class should not have, you can create a ____________________ function with the same name in the derived class.

Free
(Essay)
4.7/5
(35)
Correct Answer:
Verified

dummy or empty,empty,dummy

C++ programmers usually use the ____ access specifier for inheritance.

(Multiple Choice)
4.8/5
(33)
Match each term with the correct statement below.
Premises:
to call a function
Responses:
parent class
invoke a method
single inheritance
Correct Answer:
Verified
Premises:
Responses:
to call a function
parent class
(Matching)
4.8/5
(43)

What are the advantages provided by inheritance?

(Essay)
4.7/5
(28)

When you define a derived class, you can insert one of the three class access specifiers just prior to the ____________________ name.

(Short Answer)
5.0/5
(39)

What are the items that are never inherited by a child class?

(Essay)
4.9/5
(38)

When a class serves as a base class to other classes, all of its members are included when you create an object from a derived class. However, the members of the base class that are ____ are not directly accessible from within the child class functions.

(Multiple Choice)
4.9/5
(38)

Can you create an array of parent class objects and store child class objects in it? What happens when you do this?

(Essay)
4.7/5
(29)

With respect to inheritance, what do generalization and specialization mean?

(Essay)
4.8/5
(30)

The children of a virtual base class cannot be used as a base to another class.

(True/False)
4.8/5
(34)

A ____ function cannot be inherited.

(Multiple Choice)
4.8/5
(41)

Provide an example of a situation in which you would want to use inheritance when creating classes.

(Essay)
4.8/5
(37)

When a class is a base class you are required to define data as protected rather than private .

(True/False)
4.8/5
(49)
Match each term with the correct statement below.
Premises:
one that cannot be used from the current location
Responses:
override (a function)
parent class
derived class
Correct Answer:
Verified
Premises:
Responses:
one that cannot be used from the current location
override (a function)
(Matching)
4.8/5
(31)

Inheritance is said to use the ____ relationship.

(Multiple Choice)
4.8/5
(39)
Match each term with the correct statement below.
Premises:
class that is already known to work correctly
Responses:
single inheritance
inaccessible class member
parent class
Correct Answer:
Verified
Premises:
Responses:
class that is already known to work correctly
single inheritance
(Matching)
4.8/5
(30)

To create a class Customer that derives from the class Person , you should use the following syntax: Class Customer ____ public Person // public may be replaced // by another class access // specifier { // other statements go here };

(Multiple Choice)
4.8/5
(45)

A derived class is also called a subclass or descendant.

(True/False)
4.8/5
(41)
Showing 1 - 20 of 53
close modal

Filters

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