Design Patterns, Behavioural Design, Java, Software Development.
pop() { return mementos.pop(); } } 4. Using the Memento Pattern public class MementoPatternDemo { public static void main(String[] args) { TextEditor editor = new TextEditor(); History history = new History(); // Editing text editor.setText("First draft"); history.push(editor.save()); // Editing