Question: Which statements best describe the Gang of Four design patterns called Memento and Observer?
- Memento notifies multiple classes of changes. Observer captures and restores an object's internal state.
- Memento defers the exact steps of an algorithm to a subclass. Observer defines a new operation to a class without change.
- Memento alters an object's behavior when its state changes. Observer encapsulates an algorithm inside a class.
- Memento captures and restores an object's internal state. Observer notifies multiple classes of changes.
Answer: The correct answer of the above question is Option D:Memento captures and restores an object's internal state. Observer notifies multiple classes of changes.