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(5));
        System.out.println(obj.elementAt(1));
    }
}

a) 0
b) 3
c) 2
d) 5

1 thought on “What will be the output of the following Java code?”

Leave a Comment