Decorator favors composition over modifying the original class.
Practice this question from Quiz: Design Patterns, with options and an explanation.
Question
Decorator favors composition over modifying the original class.
Option A — Correct answer
True
Decorator composes behavior around an object while preserving the same contract.
Option B
False
Decorator composes behavior around an object while preserving the same contract.