-
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(5));
object.addElement(new Integer(7));
object.addElement(new Integer(9));
System.out.println(object.elementAt(2));
}
}
-
- 6, 3
- 5
- 7
- 9
- None of these
Correct Option: D
object.elementAt(2) returns the value stored at index 2, which is 9.