52.
What is the difference between TreeSet and SortedSet?

54.
What will be the output of the following Java code?
import java.lang.reflect.*;
class Additional_packages 
{	 
     public static void main(String args[])
     {
   try 
         {
       Class c = Class.forName("java.awt.Dimension");
 Field fields[] = c.getFields();
 for (int i = 0; i < fields.length; i++)
     System.out.println(fields[i]);
   }
   catch (Exception e)
         {
         System.out.print("Exception");
         }
    }    
}

55.
What will be the output of the following Java program?
import java.util.*;
class Collection_Algos 
{
    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);
        while(i.hasNext())
      System.out.print(i.next() + " ");
    }
}

56.
What will be the output of the following Java code?
import java.util.*;
class vector 
{
    public static void main(String args[]) 
    {
        Vector obj = new Vector(4,2);
        obj.addElement(new Integer(3));
        obj.addElement(new Integer(2));
        obj.addElement(new Integer(6));
        obj.insertElementAt(new Integer(8), 2);
        System.out.println(obj);
    }
}

60.
What will be the output of the following Java code?
import java.util.*;
class properties 
{
    public static void main(String args[]) 
    {
        Properties obj = new Properties();
        obj.put("AB", new Integer(3));
        obj.put("BC", new Integer(2));
        obj.put("CD", new Integer(8));
        System.out.print(obj.keySet());
    }
}

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.