This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Thread - Wait Doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Thread - Wait Doubt" Watch "Thread - Wait Doubt" New topic

Thread - Wait Doubt

Micheal John
Ranch Hand

Joined: Nov 01, 2006
Posts: 344
From web page

In the above pgm, why the output is coming? pls explain

Micheal John
SCJP 1.4 (86%), SCWCD 1.4 (86%), SCBCD 1.3 (85%), SCDJWS (Just Started...) - Satisfaction Lies in Our EFFORT, Not in the ATTAINMENT
Ahmed Khan Mohammed

Joined: Dec 07, 2006
Posts: 13
When I ran the program I dont see any output. It just happened (on my machine) that the notify method was called before the wait method was called.
I modified the code.

The output is
after notify
going to wait
It is sorta covered in the JavaRanch Style Guide.
subject: Thread - Wait Doubt