Intermediate Object-Oriented Programming Concepts
Q56 / 100

What is the purpose of the "Decorator" design pattern?

Correct! Well done.

Incorrect.

The correct answer is A) To attach additional responsibilities to an object dynamically without altering its class

A

Correct Answer

To attach additional responsibilities to an object dynamically without altering its class

Explanation

Decorators wrap an object to add new behavior (e.g. logging, caching) while preserving the same interface, allowing flexible feature combinations.

Progress
56/100