Consumer
public class Comsumer implements Runnable {
private CubbyHole cubbyhole;
private int number;
public Consumer(CubbyHole c, int number) {
cubbyhole=c;
this.number=number;
}
public void run() {
int value=0;
for(int i=0; i i++) {
value=cubbyhole.get();
System.out.println("Consumer #"+this.number+" got: "+i);
}
}
}
Previous slide
Next slide
Back to first slide
View graphic version