Advanced Object-Oriented Programming Concepts
Q91 / 100

What does "favor delegation over inheritance" mean as a design heuristic?

Correct! Well done.

Incorrect.

The correct answer is A) A class should hold a reference to another object and forward (delegate) certain calls to it, rather than inheriting that object's implementation

A

Correct Answer

A class should hold a reference to another object and forward (delegate) certain calls to it, rather than inheriting that object's implementation

Explanation

Delegation achieves code reuse similarly to inheritance but with looser coupling, since the delegating object can change its delegate at runtime and is not bound to the delegate's full interface or hierarchy.

Progress
91/100