Synchronized Keyword It is legal to declare static method with synchronized The transfer method declaration with synchronized public synchronized void transfer(int from, int to,doublr amount){ while (account[from] < amount) wait() ; account[from] -= amount ; account[to]+= amount; notifyAll() ; }
{}