Solved

Consider the Following Code Snippet: Queue<String> StringQueue = New LinkedList<String>();

Question 67

Multiple Choice

Consider the following code snippet: Queue<String> stringQueue = new LinkedList<String>() ;
StringQueue.add("ab") ;
StringQueue.add("abc") ;
StringQueue.add("a") ;
While (stringQueue.size() > 0)
{
System.out.print(stringQueue.remove() + ",") ;
}
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