X954: Stack push & pop - 2

For this question, assume we have a stack created and stored in the variable s. This stack supports the usual push(), pop(), and clear() methods and stores Strings. Select the best answer that reflects the content of the stack after the following lines are executed.

s.clear();
s.push("A");
String x = s.pop();
s.push("B");
s.push("C");
s.push(x);

Your Answer:

Select one answer:


Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.