A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Programmer Certification (SCJP/OCPJP)
Joined: Jun 11, 2005
Jul 30, 2005 11:42:00
regarding this expression:
"A call to wait/notify must be within synchronized code. It will throw an error message ..."
My question :
?Under any circunstances the compiler detects this problem to produce a compiling error instead of a runtime error?
Thanks in advance for the answers
Joined: Jan 30, 2000
Jul 30, 2005 12:35:00
No. It's only at runtime that this error is detected.
"I'm not back." - Bill Harding,
Joined: Jul 08, 2005
Jul 31, 2005 16:30:00
Yes,it throws an exception at runtime:
: current thread not owner
SCWCD 1.4(In progress)<br />SCJP 5.0<br />IBM Certified Solutions Expert for Webshpere Studio, V3.5 (retired)
I agree. Here's the link:
IllegalMonitorStateException from notify()
wait method calls
Why no compilation failure
Mock exam question
Runtime Time Exception
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015