Question: How can I do this in java? E undo(): if the undo stack is not empty, pop the top element off of the undo stack,
How can I do this in java?
- E undo(): if the undo stack is not empty, pop the top element off of the undo stack, push it onto the redo stack, and return the element. Otherwise, return null.
- E redo(): if the redo stack is not empty, pop the top element off of the redo stack, push it onto the undo stack, and return the element. Otherwise, return null.
public class DynamicNavStack
private E[] navStack; //stack name
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
