This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes MultiThreading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "MultiThreading" Watch "MultiThreading" New topic
Author

MultiThreading

Tukaram Ugile
Greenhorn

Joined: Mar 03, 2010
Posts: 4
Dear All,

what is the difference between stop() and yield()?

As far as I know yield method keeps the currently running thread in ready-to-run state.What happens when the stop() method is called on the currently running thread?What is the state of the thread?

Thanks.

Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

Did you give it a try. Take a look at the documentation for the stop method in the -> java.lang.Thread class


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

The stop method is deprecated so you don't have to worry about it for SCJP...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

Tukaram Ugile wrote:Dear All,

what is the difference between stop() and yield()?

As far as I know yield method keeps the currently running thread in ready-to-run state.What happens when the stop() method is called on the currently running thread?What is the state of the thread?

Thanks.



It will go to Dead state. No more Thread - of - execution!


|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MultiThreading
 
Similar Threads
Call to yield() and thread state?
yield() on synchronized code
Thread
Marcus Green #3 Question 44
Marcus Mock3 Q#44