Question: Assume I have a stack of integer elements called st. What is going to be printed after I run the following statements? st.push(2); st.push(5); st.pop
Assume I have a stack of integer elements called st. What is going to be printed after I run the following statements? st.push(2); st.push(5); st.pop st.push(1); st.peekO; st.push(12); st.push(25) st.pop st.popO; System.out.println(st.peek0); System.out.println(st.size0)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
