Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.
bhanulakshmi
stranger
Reged: 08/05/08
Posts: 1
|
|
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
|
kafrlust
journeyman
Reged: 05/31/06
Posts: 81
Loc: Greece
|
|
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)
|
|
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: 4463
|
|
|
|
|
|
Powered by UBB.threads™ 6.5.5