-
What is the output of this program?
import java.util.*;
public class Collection_iterators_Example
{
public static void main(String args[])
{
ListIterator object = List.istIterator();
if(object.previousIndex()!= -1)
while(object.hasNext())
System.out.print(object.next() + " ");
else
System.out.print("EMPTY");
}
}
-
- Compilation Error
- Runtime Error
- EMPTY
- empty
- None of these
Correct Option: A
Output:
Collection_iterators_Example.java:6: error: cannot find symbol
ListIterator object = List.istIterator();
^
symbol: method istIterator()
location: interface List
1 error