51. What will be the output of the following Java program?
import java.util.*;
class Maps
{
public static void main(String args[])
{
HashMap obj = new HashMap();
obj.put("A", new Integer(1));
obj.put("B", new Integer(2));
obj.put("C", new Integer(3));
System.out.println(obj.keySet());
}
}
import java.util.*;
class Maps
{
public static void main(String args[])
{
HashMap obj = new HashMap();
obj.put("A", new Integer(1));
obj.put("B", new Integer(2));
obj.put("C", new Integer(3));
System.out.println(obj.keySet());
}
}
52. What will be the output of the following Java code?
import java.util.*;
class date
{
public static void main(String args[])
{
Date obj = new Date();
System.out.print(obj);
}
}
import java.util.*;
class date
{
public static void main(String args[])
{
Date obj = new Date();
System.out.print(obj);
}
}
53. What is the worst case complexity of accessing an element in ArrayList?
54. What is the length of the application box made in the following Java program?
import java.awt.*;
import java.applet.*;
public class myapplet extends Applet
{
Graphic g;
g.drawString("A Simple Applet",20,20);
}
import java.awt.*;
import java.applet.*;
public class myapplet extends Applet
{
Graphic g;
g.drawString("A Simple Applet",20,20);
}
55. If large number of items are stored in hash bucket, what happens to the internal structure?
56. Which of these standard collection classes implements a dynamic array?
57. What is the default clone of HashSet?
58. What is the correct method used to insert and delete items from the queue?
59. Which of these standard collection classes implements all the standard functions on list data structure?
60. What happens if two threads simultaneously modify TreeSet?
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.