Home » JAVA Programming » Collections » Question
  1. What is the output of this program?
    import java.util.*;
    public class vector_Example
    {
    public static void main(String args[])
    {
    Vector object = new Vector(6,3);
    object.addElement(new Integer(10));
    object.addElement(new Integer(20));
    object.addElement(new Integer(60));
    object.insertElementAt(new Integer(80), 1);
    System.out.println(object);
    }
    }
    1. [10, 20, 60, 80]
    2. [10, 20, 60] 4
    3. [10, 20, 60]
    4. [20, 60, 80]
    5. [10, 80, 20, 60]
Correct Option: E

[10, 80, 20, 60]



Your comments will be displayed only after manual approval.