This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Angus Ferguson wrote:Sometimes they are locked waiting for another thread
No, methods don't get locked. They may get 'blocked' that is, not be able to execute as the try to get access to an Object's synchronization lock. But a method is not locked, has no lock of its own, and can't be released.
Niraj Jha wrote:With the help of wait() and notify() you can handle the release problem.
Only if the problem is related to wait() and notify(). It is unclear that Angus is talking about a problem or just discussing things to learn about them (I assume the second by the type of question). Since Angus has not mentioned wait() or notify() I would not jump to the conclusion that they will help or explain anything, because they are not really related to synchronized methods (except, in that they may be working on the same locks).