This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Getting MEAN with Mongo, Express, Angular, and Node and have Simon Holmes on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Threads" Watch "Threads" New topic


Puja S
Ranch Hand

Joined: Jan 06, 2005
Posts: 51

If Object.wait( ) method is called from a synchronized method,then the current thread will move to the waiting state until some other thread invokes the notify ( ) or notifyAll ( ) method on this object.

Can any body tell me that when the thread moves to the waiting state,will it release the lock ?

Dave Wood
Ranch Hand

Joined: Aug 02, 2004
Posts: 161

(if it didn't, no other thread could call notify...because you have to have the lock to call those methods)

Remember, javadoc is your friend!
[ January 06, 2005: Message edited by: Dave Wood ]

Co-Author of <a href="" target="_blank" rel="nofollow">Java Swing</a><br />Co-Creator of <a href="" target="_blank" rel="nofollow">SCJP 5.0</a> and <a href="" target="_blank" rel="nofollow">SCJA</a> exams
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
"Puja" welcome to JavaRanch. Please read our JavaRanch Naming Policy and change your displayed name to conform with it. We require a <first name> <family name> format, preferably your real names.

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
It is sorta covered in the JavaRanch Style Guide.
subject: Threads