Syntax : public boolean remove(Object o);
See Example:
import java.util.Vector;
public class Example {
public static void main(String args[]) {
Vector vector = new Vector(3);
vector.add(3);
vector.add(1);
vector.add(2);
System.out.println("Vector before remove element: "+vector);
System.out.println("Removed element from vector: "+vector.remove((Integer)1));
System.out.println("Vector after remove element: "+vector);
}
}
//result :
Vector before remove element: [3, 1, 2]
Removed element from vector: true
Vector after remove element: [3, 2]
EmoticonEmoticon