ExamVeda
Login
Home
51
Which of these interface declares core method that all collections will have?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
52
What is the difference between TreeSet and SortedSet?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
53
Map implements collection interface?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
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");
         }
    }    
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
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() + " ");
    }
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
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);
    }
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
57
Which of these methods sets every element of a List to a specified object?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
58
Which of these methods can be used to delete the last element in a LinkedList object?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
59
Which of these method is used to add an element to the start of a LinkedList object?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
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());
    }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board