Question: Inheritance binds the classes closer together This is an example of trading-off increased coupling in exchange for reduced code duplication. Sometimes composition can achieve (perhaps
Inheritance binds the classes closer together This is an example of trading-off increased coupling in exchange for reduced code duplication. Sometimes composition can achieve (perhaps somewhat less) reduction in code duplication while minimizing coupling between classes. Give an example pair of classes with two variations: one using inheritance and one using composition. Discuss the pros and cons.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
