public boolean add(E e);
See Example :
import java.util.Collections;
import java.util.Enumeration;
import java.util.Vector;
public class Example1 {
public static void main(String args[]) {
Vector<String> vec = addVector();
System.out.println("Elements Vector : "+vec);
System.out.println("Vector size : "+vec.size());
}
public static Vector<String> addVector(){
/* Vector of initial*/
Vector<String> vectors = new Vector<String>();
/* Adding elements to a vector*/
vectors.addElement("Item1");
vectors.addElement("Item2");
vectors.addElement("Item3");
vectors.addElement("Item4");
vectors.addElement("Item5");
return vectors;
}
}
//result :
Elements Vector : [Item1, Item2, Item3, Item4, Item5]
Vector size : 5
EmoticonEmoticon