public synchronized void withdraw(double amount) throws InterruptedException { while (balance < amount) wait(); }