Which behavioral pattern provides a way to capture and restore an object’s internal state without violating encapsulation (enabling Undo mechanisms)?
APrototype Pattern
BCommand Pattern
CMemento Pattern
DVisitor Pattern
Explanation
The Memento pattern captures an object’s internal state so it can be restored later without exposing its private fields.

No Comments