Pergunta de entrevista da empresa Lutron Electronics

(continuing Q2) Then we'd also want to have a redo() method. Implement this!

Resposta da entrevista

Sigiloso

10 de mar. de 2011

I used another stack. If an undo() is called, pop that from undo stack, create a new object which holds undo's method and current value, and push that into redo stack. And then revert the rectangle's value into what was in undo's stack. Remember to clear out redo stack after you undo something and call a new method!

1