This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
This question (originally) comes from one of my mock exams, and it includes the following explanation with the answer.
Compilation but runtime error.
At runtime an error indicating java.lang.IllegalMonitorStateException because the wait call is not within synchronized code. Changing the signature of payBill to public synchronized void payBilll would remove the runtime error, causing the program to run and then pause with no output.
Does the explanation look correct, and if so is there something I can do to change the answer to make the explanation more clear? [ December 19, 2005: Message edited by: Marcus Green ]