括号错了 public synchronized void put(String message) {
// wait until message has been retrieved.
while (!empty) {
try {
wait();
} catch (InterruptedException e) { }
}//***这个括号你到下面去了
// Toggle staus.
empty = false;
// store message.
this.message = message;
// Notify consumer that status has changed.
notifyAll();

}