Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld >> Java Beginner

Pages: 1
bhanulakshmi
stranger


Reged: 08/05/08
Posts: 1
Java thread
      #182226 - 08/21/08 07:15 AM

Hi,

I am new to java. I would like to know
Whatis the difference between Yield() and wait() method? Both Causes the currently executing thread object to temperorily pause and allow other thread
to execute.

Thanks
Bhanulakshmi


Post Extras: Print Post   Remind Me!   Notify Moderator  
kafrlust
journeyman


Reged: 05/31/06
Posts: 81
Loc: Greece
Re: Java thread [Re: bhanulakshmi]
      #182237 - 08/21/08 09:15 AM

Hey!!Yield() is used to put the currently running thread in runnable state and let and let another thread with the same priority to take its turn. wait() is used to stop a running thread until another thread completes and notify it that "its job is done"

--------------------
reach whatever you can't reach(N.Kazantzakis)


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 3 anonymous users are browsing this forum.

Moderator:   

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 4444

Rate this topic

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5