Question: I have a Stack of String(s). I push Peter onto the Stack. I push Brian onto the Stack. I push Stewie onto the Stack. I
I have a Stack of String(s). I push "Peter" onto the Stack. I push "Brian" onto the Stack. I push "Stewie" onto the Stack. I push "Lois" onto the Stack. I push "Meg" onto the Stack. I pop one String from the Stack. (1st pop)
1. If I System.out.println the result of the next pop operation (2nd pop), what String will be printed?
2. After the 2nd pop(), what is the size of the Stack now?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
