Chapter 22: Problem 4
\(\quad\) a) Classes allow us to create as many data structure objects as we wish. b) Inheritance enables a subclass to reuse the functionality from a superclass. Public and protected superclass methods can be accessed through a subclass to eliminate duplicate logic. c) Composition enables a class to reuse code by storing a reference to an instance of another class in a field. Public methods of the instance can be called by methods in the class that contains the reference.
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.