// for (Iterator iterator = tickets.iterator(); iterator.hasNext();) {
// String string = (String) iterator.next();
// tickets.remove(20);
// }
for (int i = 1; i <= 10; i++) {
new Thread("线程" + i) {
public void run() {
while (true) {
if (tickets.isEmpty()) {
break;
}
System.out.println(Thread.currentThread().getName() + "---" + tickets.remove(0));
}
}
}.start();
}
}
}