my dog learned polymorphism
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Marcus Green question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Marcus Green question" Watch "Marcus Green question" New topic

Marcus Green question

Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
What can cause a thread to stop executing?
1) The program exits via a call to System.exit(0);
2) Another thread is given a higher priority
3) A call to the thread's stop method.
4) A call to the halt method of the Thread class?
Answer : 1,2,3
I answered 1,2 (not 3 because stop() is deprecated). If I get a question similar to this one, should I choose 3 even though the method is deprecated?

I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
In the exam there will not be questions about deprecated method. However if you are asked, stop will definitely stop the thread.

SCJP2. Please Indent your code using UBB Code
Brian Joseph
Ranch Hand

Joined: May 16, 2003
Posts: 160
That's tricky because it says "CAN" and not "WILL" I got that one wrong.
subject: Marcus Green question
It's not a secret anymore!