aspose file tools*
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 Spring in Action this week in the Spring 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: 6662
    
    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: 9305
    
  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%|
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: MultiThreading