Solved

Consider the Following Code Snippet: Stack<String> StringStack = New Stack<String>();

Question 25

Multiple Choice

Consider the following code snippet: Stack<String> stringStack = new Stack<String>() ;
StringStack.push("ab") ;
StringStack.push("abc") ;
StringStack.push("a") ;
While (stringStack.size() > 0)
{
System.out.print(stringStack.pop() + ",") ;
}
What output will be produced when this code is executed?


A) ab,abc,a,
B) a,abc,ab,
C) a,ab,abc,
D) abc,ab,a,

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions