Copyright © 2001 Qusay H. Mahmoud
19
wait() and notify()
lConsumer:
lprivate List objects = new ArrayList();
l
lprivate Object remove() throws InterruptedException {
l  synchronized(objects) {
l     objects.wait();
l  }
l  Object obj = objects.get(0);
l  objects.remove(0);
l}