← Quiz: Observer, Strategy and Decorator: all 10 questions
Quiz: Observer, Strategy and Decorator · Question 1 of 10
In the Observer pattern, what does the subject know about its observers?
In the Observer pattern, what does the subject know about its observers?
- A.Their concrete classes, so it can call special methods
- B.Only that they implement the listener interface
- C.Nothing — observers poll the subject for changes
- D.The order in which they were compiled
Answer & explanation
Correct answer: Only that they implement the listener interface
The subject only calls the interface method, so new observers can be added without editing it.
Can you get the rest right without peeking?
Take the timed Quiz: Observer, Strategy and Decorator quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →