Question: in Java code please Write java code to find what are the contents of the stack pile and the value of the result after the

Write java code to find what are the contents of the stack pile and the value of the result after the following statements execute. StackInterface pile = new MyStack >(); pile.push("Jazmin"); pile.push ("Jess"); pile.push("Jack"); pile.push (pile.pop()); pile.push (pile.peek()); pile.push("Seiji"); String name = pile.pop(); pile.push (pile.peek()); /* Add your code here to print the contents of the stack */ int n=4; StackInterface stack = new MyStack(); while (n>0) \{ stack.push (n); n; \} / int resul while =1; ind your code here: while stack is not empty pop a number from the stack, multiply the 'result' by the poped number, save it to the 'result' "/ System. out.println ("result = " result); 3. By midnight, Tuesday, February 7th, submit your Java source file (Main.Java) and a screenshot of the execution result via the 'Lab3 - Ch5 Stacks' under the 'Submit Lab Assignments' menu in the course Blackboard. At the beginning of the code, add a Lab 3 - Chapter 5 Stacks 2/7/2023 1. Using the class java.util.Stack, define a class MyStack that implements the following StackInterface
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
