Which of the following is true? Before you answer, define smaller in this context.

a. When class D is derived from class B, the base class is usually smaller.
b. A subclass is usually smaller than the superclass.
c. A parent class is usually larger than a child class.
d. A class that inherits is usually larger than the class from which it inherits.

Smaller means has fewer member functions and/or member variables. Part a) and d) are correct.
Explanation: Parts b), c) are backwards. Part a) uses the language of the text, and is correct. Part d) is consistent with the text’s usage but doesn't say, “derived” and “base” class. In part b), a subclass is the derived class; a superclass is the base class. The base class is smaller. In part c), the child class is the derived class and the parent class is the base class. The base class is smaller, meaning has fewer members. Note that if ‘smaller” means has fewer objects of the class type, then the answers reverse.

Computer Science & Information Technology

You might also like to view...

Which of the following is NOT an aspect of access regulated by ACLs?

A. what authorized users can access B. where the system is located C. how authorized users can access the system D. when authorized users can access the system

Computer Science & Information Technology

The following algorithm represents the logic of a(n) ____.For maxElement = ARRAYSIZE - 1 To 1 Step - 1   For index = 0 To maxElement - 1      If someNums[index] > someNums[index + 1] Then         temp = someNums[index]            someNums[index] = someNums[index + 1]            someNums[index + 1] = temp      End If   End ForEnd For

A. selection sort B. insertion sort C. bubble sort D. merge sort

Computer Science & Information Technology