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.
a) When class D is derived from class B, the base class is usually smaller. , and d) A class that inherits is usually larger than the class from which it inherits.
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.
You might also like to view...
Describe the L2TP Layer 2 Tunneling Protocol (L2TP).
What will be an ideal response?
In a UML activity diagram, a(n) symbol joins two flows of activity into one flow of activity.
a) merge b) combine c) action state d) decision