Question: Which statements best describe the Gang of Four design patterns called Memento and Observer?

  1. Memento notifies multiple classes of changes. Observer captures and restores an object's internal state.
  2. Memento defers the exact steps of an algorithm to a subclass. Observer defines a new operation to a class without change.
  3. Memento alters an object's behavior when its state changes. Observer encapsulates an algorithm inside a class.
  4. 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.