File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Thread 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 "Thread Question" Watch "Thread Question" New topic

Thread Question

Karen Liu

Joined: Sep 14, 2003
Posts: 16
I have this question:
Which methods may cause a thread to stop executing?

I chose sleep(), yield() and wait().
While answer includes stop().
Stop() is deprecated, and my question is:
do deprecated methods still need to be considered in SCJP 1.4?
Charles Lyons
Ranch Hand

Joined: Mar 27, 2003
Posts: 836
As far as I can remember from my preparation from the exam, deprecated methods aren't tested - so you only really need to know about wait(), notify(), notifyAll(), sleep(), yield(), join() and run() as well as the Thread constructors.
Of course, a little bit of extra knowledge about Java's history can't hurt; besides, it sounds like you've already covered enough about stop() to know what it does and where it might be used (or misused!) anyway.
Please correct me if I'm wrong or if I've missed any required methods out...

Charles Lyons (SCJP 1.4, April 2003; SCJP 5, Dec 2006; SCWCD 1.4b, April 2004)
Author of OCEJWCD Study Companion for Oracle Exam 1Z0-899 (ISBN 0955160340 / Amazon Amazon UK )
I agree. Here's the link:
subject: Thread Question
It's not a secret anymore!