Welcome to www.mcqtutorial.com!!!!
      
      
MCQ Tutorial Search
Home Search Add Question Today's History Discussion Board Job Portal JAVA Core JAVA Multi Threading

Collection

JDBC SWING SERVLET JSP Advance Java Other Struts Hibernate Mock Test Contact Feedback
Home
Search
Add Question
Today's History
Discussion Board
Job Portal
JAVA
Core JAVA
Multi Threading

Collection

JDBC
SWING
SERVLET
JSP
Advance Java Other
Struts
Hibernate
Mock Test
Subscribe/Unsubscribe
Email:
Social Media
Facebook

Misc Tutorials

References

Question and Answer Tutorial
Tutorials Point
Stack Overflow

MCQ Tutorial - JAVA->Collection

First Previous 1 2 3 4 Next Last
                        
11.) What is the output of this program?

    import java.util.*;
    class Bitset 
    {
        public static void main(String args[]) 
        {
            BitSet obj = new BitSet(5);
            for (int i = 0; i < 5; ++i)
                obj.set(i);
            obj.clear(2);
            System.out.print(obj);
        }
    }
Options are:
A.) {0, 0, 0, 3, 4}
B.) {0, 1, 2, 4}
C.) {0, 1, 2, 3, 4}
D.) {0, 1, 3, 4}
12.) What is the output of this program?

    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));
            obj.remove(new String("A"));
            System.out.print(obj);
        }
    }
Options are:
A.) {C=8, B=2}
B.) {A=3, C=8, B=2}
C.) [A=3, C=8, B=2]
D.) [C=8, B=2]
13.) What is the output of this program?

    import java.util.*;
    class stack 
    {
        public static void main(String args[]) 
        {
            Stack obj = new Stack();
            obj.push(new Integer(3));
            obj.push(new Integer(2));
            obj.pop();
            obj.push(new Integer(5));
          System.out.println(obj);
        }
    }
Options are:
A.) [3,5]
B.) [3,5,2]

C.) [3,2,5]
D.) [3,2]
14.) What is the output of this program?

    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(5));
            obj.removeAll(obj);
            System.out.println(obj.isEmpty());
        }
    }
Options are:
A.) true
B.) False
15.) What is the output of this program?

    import java.util.*;
    class Array 
    {
        public static void main(String args[]) 
        {
            int array[] = new int [5];
            for (int i = 5; i > 0; i--)
                array[5-i] = i;
            Arrays.fill(array, 1, 4, 8);
            for (int i = 0; i < 5 ; i++)
                System.out.print(array[i]);
        }
    }
Options are:
A.) 12845
B.) 58881
C.) 12885
D.) 54881
                        
                        
First Previous 1 2 3 4 Next Last
                        
Comment:
Name:Email:
Contact No.:
Copyright © 2014 by SBJ Group. All Rights Reserved. Developed and maintained by SBJ Group. Supported on Internet Explorer browser only