✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Consider the code snippet shown below:
Stack<String> words1 = new Stack<>();
Stack<String> words2 = new Stack<>();
words1.push("abc");
words1.push("def");
words1.push("ghi");
while (!words1.empty())
{
words2.push(words1.pop());
}
while (!words2.empty())
{
System.out.print(words2.pop());
}
What will be printed when this code is executed?
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!