71.
What will be the output of the following Java program?
import java.util.*;
class Collection_iterators 
{
    public static void main(String args[]) 
    {
        LinkedList list = new LinkedList();
        list.add(new Integer(2));
        list.add(new Integer(8));
        list.add(new Integer(5));
        list.add(new Integer(1));
        Iterator i = list.iterator();
        Collections.reverse(list);
  Collections.shuffle(list);
        i.next();
        i.remove();
        while(i.hasNext())
      System.out.print(i.next() + " ");
    }
}

76.
When two threads access the same ArrayList object what is the outcome of the program?

77.
What will be the output of the following Java program?
import java.util.*;
class Output 
{
    public static void main(String args[]) 
    {
        ArrayList obj = new ArrayList();
        obj.add("A");
        obj.add(0, "B");
        System.out.println(obj.size());
    }
}

Read More Section(Collections Framework in java)

Each Section contains maximum 100 MCQs question on Collections Framework in java. To get more questions visit other sections.