Sail E0 Webinar
Question


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));
System.out.println(obj.capacity());
}
}
Options:
A .  2
B .  3
C .  4
D .  6
Answer: Option C

None.
Output:
$ javac vector.java
$ java vector
4



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers