Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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


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 "Thread Question" Watch "Thread Question" New topic
Author

Thread Question

Karen Liu
Greenhorn

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

sleep();
stop();
yield();
wait();
notify();
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?
Thanks
Karen
Charles Lyons
Author
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 )
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Thread Question
 
Similar Threads
Threads Execution
What to do if a question include Deprecated Methods in Exams
Deprecated thread methods
Can i use stop() to stop the thread.
on threads