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

73.
What will be the output of the following Java program?
import java.util.*;
class Maps 
{
    public static void main(String args[]) 
    {
        TreeMap obj = new TreeMap();
        obj.put("A", new Integer(1));
        obj.put("B", new Integer(2));
        obj.put("C", new Integer(3));
        System.out.println(obj.entrySet());
    }
}

79.
What will be the output of the following Java code?
import java.util.*;
class hashtable 
{
    public static void main(String args[]) 
    {
        Hashtable obj = new Hashtable();
        obj.put("A", new Integer(3));
        obj.put("B", new Integer(2));
        obj.put("C", new Integer(8));
        System.out.print(obj.toString());
    }
}

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.