Vector
Tuesday, 21 June 2011
import java.util.*;
public class VectorDemo {
public static void main(String[] args) {
Vector v=new Vector();
System.out.println(v.capacity());
for(int i=0;i<10;i++){
v.add(i);
}
System.out.println(v.capacity());
v.addElement("A");
System.out.println(v.capacity());
System.out.println(v);
}
}
public class VectorDemo {
public static void main(String[] args) {
Vector v=new Vector();
System.out.println(v.capacity());
for(int i=0;i<10;i++){
v.add(i);
}
System.out.println(v.capacity());
v.addElement("A");
System.out.println(v.capacity());
System.out.println(v);
}
}
0 comments:
Post a Comment