← Quiz: Design Patterns: all 10 questions
Quiz: Design Patterns · Question 6 of 10
What is the key difference between Adapter and Decorator?
What is the key difference between Adapter and Decorator?
- A.Adapter adds features; Decorator changes the interface
- B.They are the same pattern
- C.Adapter changes an interface to match another; Decorator keeps the same interface and adds behaviour
- D.Decorator is creational, Adapter is behavioural
Answer & explanation
Correct answer: Adapter changes an interface to match another; Decorator keeps the same interface and adds behaviour
A decorated object can be used exactly like the original.
Can you get the rest right without peeking?
Take the timed Quiz: Design Patterns quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →