• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Thread Question

 
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 657
Spring VI Editor Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then its another wrong question from JDiscuss.
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic