The difference is that add() will always return true, while addElement() has no return value.
public boolean add(Object element) public void addElement(Object element)
import java.util.Vector;
public class MainClass { public static void main(String args[]) {
Vector v = new Vector(5); for (int i = 0; i < 10; i++) {
v.add(i);
}
System.out.println(v);
}
}