Class -6-What will happen if you compile/run the folowing lines of code?
package net.dharmaraj;
import java.util.*;
public class dev {
public static void main(String[] xyz) {
Vector a = new Vector();
// a.addElement(new Integer(10));
a.addElement(10);
System.out.println(a.elementAt(0));
}
}
1: Vector a = new Vector();
2:
3: a.addElement(10);
4:
5: System.out.println(a.elementAt(0));
A) Prints 10.
B) Prints 11.
C) Compilation error at line 3.
D) Prints some garbage.
No comments:
Post a Comment