Examveda

What will be the output of the following Java program?
import java.util.*;
class Collection_iterators 
{
    public static void main(String args[]) 
    {
        ListIterator a = list.listIterator();
            if(a.previousIndex()! = -1)
                while(a.hasNext())
              System.out.print(a.next() + " ");
            else
               System.out.print("EMPTY");
    }
}

A. 0

B. 1

C. -1

D. EMPTY

Answer: Option D


This Question Belongs to Java Program >> Collections Framework In Java

Join The Discussion

Related Questions on Collections Framework in java