LLD - Behavioral Design Patterns — Part 1
Which of the following is the correct way to register an observer in the Observer pattern?
subject = Subject()
observer = ConcreteObserver()
# What code registers the observer?Which of the following is the correct way to register an observer in the Observer pattern?
subject = Subject()
observer = ConcreteObserver()
# What code registers the observer?attach or addObserver to register observers.addObserver is used in some languages, attach is the classic and widely accepted method name.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions