What will be the output of the following Java code? [code] import java.util.*; class vector { public static void

What will be the output of the following Java code?
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.capacity());
        }
    }
A. 2
B. 3
C. 4
D. 6
 

Tìm kiếm

Back
Top