The methods of Vector are synchronized.
import java.util.Iterator;
import java.util.Vector;
public class MainClass {
public static void main(String[] argv) {
Vector vec = new Vector();
for (int i = 101; i <= 110; i++)
vec.add(i);
Iterator iter = vec.iterator();
while (iter.hasNext())
System.out.println(iter.next());
}
}
101
102
103
104
105
106
107
108
109
110
8.14.Vector |
| 8.14.1. | The most common class that implements List is Vector. |