public class Test {
static Vector vector = new Vector();
public static void main(String[] args) throws InterruptedException {
while(true) {
for(int i=0;i
vector.add(i);
Thread thread1 = new Thread(){
public void run() {
for(int i=0;i
vector.remove(i);
};
};
Thread thread2 = new Thread(){
public void run() {
for(int i=0;i
vector.get(i);
};
};
thread1.start();
thread2.start();
while(Thread.activeCount()>10) {
}
}
}
}