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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!