This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
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.
It is sorta covered in the JavaRanch Style Guide.
subject: Marcus Green question
It's not a secret anymore!