71. Which of these is a method of ListIterator used to obtain index of previous element?
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);
}
}
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());
}
}
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());
}
}
74. Which of these method is used to calculate number of bits required to hold the BitSet object?
75. Which of these Exceptions is thrown by remote method?
76. When an array is passed to a method, will the content of the array undergo changes with the actions carried within the function?
77. Which of these class object has an architecture similar to that of array?
78. Which of these method of Array class is used sort an array or its subset?
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());
}
}
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());
}
}
80. Which of these is the interface of legacy is implemented by Hashtable and Dictionary classes?
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.