• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thread Question

 
Karen Liu
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic