Solved

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

Question 73

Multiple Choice

Consider the following code snippet: LinkedList<String> myLList = new LinkedList<String>() ;
MyLList.add("Mary") ;
MyLList.add("John") ;
MyLList.add("Sue") ;
ListIterator<String> iterator = myLList.listIterator() ;
Iterator.next() ;
Iterator.next() ;
Iterator.add("Robert") ;
Iterator.previous() ;
Iterator.previous() ;
Iterator.remove() ;
System.out.println(myLList) ;
What will be printed when this code is executed?


A) [Mary, John, Robert, Sue]
B) [Mary, John, Sue]
C) [Mary, Robert, Sue]
D) [John, Robert, Sue]

Correct Answer:

verifed

Verified

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

Related Questions