Solved

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

Question 19

Multiple Choice

Consider the following code snippet: LinkedList<String> words = new LinkedList<String>() ;
Words.addFirst("123") ;
Words.addLast("456") ;
Words.addFirst("789") ;
System.out.print(words.removeLast() ) ;
System.out.print(words.removeFirst() ) ;
System.out.print(words.removeLast() ) ;
What does this code print?


A) 123456789
B) 789123456
C) 123789456
D) 456789123

Correct Answer:

verifed

Verified

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

Related Questions