Home » JAVA Programming » Collections » Question
  1. What is the output of this program?
    import java.util.*;
    public class vector
    {
    public static void main(String args[])
    {
    Vector object = new Vector(6,3);
    object.addElement(new Integer(9));
    object.addElement(new Integer(7));
    object.addElement(new Integer(3));
    System.out.println(object.capacity());
    }
    }
    1. 3
    2. 6
    3. 9
    4. 7
    5. None of these
Correct Option: B

6



Your comments will be displayed only after manual approval.