Multiple Choice
Consider the code snippet shown below: Stack<String> words1 = new Stack<String>() ;
Stack<String> words2 = new Stack<String>() ;
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?
A) abcdefghi
B) ghiabcdef
C) abcghidef
D) defghiabc
Correct Answer:

Verified
Correct Answer:
Verified
Q11: Complete the following code, which is intended
Q12: When using a list iterator, on which
Q13: Select an appropriate declaration to complete the
Q14: What is the meaning of the type
Q15: You intend to use a hash set
Q17: Assume you have created a linked list
Q18: What operation is least efficient in a
Q19: Which of the following statements about the
Q20: Which data structure would best be used
Q21: A collection without an intrinsic order is