Meaningless Drivel is fun!
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

Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
Which of the following may pause/stop the current thread?


Select 4 correct options.

1.calling Thread.yield()
2.calling stop() on an object of class Thread.
3.calling someObject.wait()
4.calling someObj.notify()
5.calling waitForAll() on MediaTracker Object.

Answer given: options 1,2,3,5

The stop() method is deprecated in java 1.4. Then how JDiscuss Test3 is saying this option is correct. and there is also no method called

Please comment

Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Steve Morrow
Ranch Hand

Joined: May 22, 2003
Posts: 657

Thread.stop() is deprecated, but it will force the currently running thread to stop. I agree, it is a poor choice for an option on the test.

Also, there *is* a waitForAll() method defined in MediaTracker, which you can read about by consulting the API javadocs.
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
Then its another wrong question from JDiscuss.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
not only is it a poor option, it's an option you'll never find on the 1.4 and 5.0 exams as deprecated methods and classes aren't part of the exam.

I agree. Here's the link:
subject: Thread Question
It's not a secret anymore!