Question: JAVA 1. After the following statements execute, what string is at the top of the stack and what string is at the bottom? Stackinterfaces String>
JAVA
1. After the following statements execute, what string is at the top of the stack and what string is at the bottom? Stackinterfaces String> stringstacks new OurStack0; stringStack.push("Jim"); stringStack.push("Jess"); stringStack.pop0: stringStack.push(Jil"); stringStack.push("Jane"); stringStack.pop0; 2. Consider the stack that was created in Question 1, and define a new empty stack nameStack. a. Write a loop that pops the strings from stringStack and pushes them onto nameStack. b. Describe the contents of the stacks stringStack and nameStack when the loop that you just wrote completes its execution. 3. Implement all the methods of the stacklnterface in class Stack. Create a demo class to test all methods using string as a datatype. 4. Implement all the methods of the stacklnterface in class Stack. Create a demo class to test all methods using Employee as a datatype
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
