All pastes #330264 Raw Edit

Anonymous

public java v1 · immutable
#330264 ·published 2007-01-27 19:19 UTC
rendered paste body
public class Cashier implements Runnable {    private CustomerLine line;    private static boolean allDoneYet;    public Cashier(CustomerLine line) {        this.line = line;        allDoneYet = false;    }    public void run() {        while (!allDoneYet) {            if (!line.isEmpty()) {                Customer c = line.dequeue();                c.process();                if (allDoneYet = c.isLast())                    notifyAll();            }            else Thread.wait();        }    }}Compile: parker@chroma ~/Desktop/Store $ !javacjavac *.javaCashier.java:19: non-static method wait() cannot be referenced from a static context                        else Thread.wait();