Assume that a stack has been declared and instantiated with the
ArrayDequeclass. Show the output produced by the following code fragment:
stack.push(1);stack.push(2);System.out.println(stack.pop());stack.push(3);System.out.println(stack.peek());stack.push(4);while (!stack.isEmpty()){ System.out.println(stack.pop());}System.out.println(stack.peek());You should be able to do this by just thinking about it, but feel free to complete and run a program to check your answer.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.