This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thread Question

 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the following may pause/stop the current thread?

Options

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
waitForAll().

Please comment
 
Steve Morrow
Ranch Hand
Posts: 657
Clojure Spring VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1026
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then its another wrong question from JDiscuss.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic