• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Thread class Methods

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which of the following are methods of the Thread class?
1) yield()
2) sleep(long msec)
3) go()
4) stop()
Answer: 1,2 and 4.

Why is option 4 valid?
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you looked at the Thread class documentation?: java.lang.Thread#stop()

It's a deprecated method you shouldn't use, though. That might be an old question. Where are you quoting it from?
 
sharma ishu
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Matthew Brown wrote:Have you looked at the Thread class documentation?: java.lang.Thread#stop()

It's a deprecated method you shouldn't use, though. That might be an old question. Where are you quoting it from?


This is from a mock test of year 2009.
So, you mean to say that if this question occurs in the exam now then only options 1 and 2 will be correct? Please tell me if I am right or wrong.
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sharma ishu wrote:This is from a mock test of year 2009.
So, you mean to say that if this question occurs in the exam now then only options 1 and 2 will be correct? Please tell me if I am right or wrong.


The method still exists in the Thread class, so 4 would still be correct. But I think it would be a very poor question to ask about deprecated methods. But then, it was already a poor question in 2009. I'd be surprised if the real exam asked it, but I can't be sure they wouldn't.
 
sharma ishu
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Matthew Brown wrote:

sharma ishu wrote:This is from a mock test of year 2009.
So, you mean to say that if this question occurs in the exam now then only options 1 and 2 will be correct? Please tell me if I am right or wrong.


The method still exists in the Thread class, so 4 would still be correct. But I think it would be a very poor question to ask about deprecated methods. But then, it was already a poor question in 2009. I'd be surprised if the real exam asked it, but I can't be sure they wouldn't.


It was in some mock test. NOT in real exam.
 
author
Posts: 23959
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sharma ishu wrote:
It was in some mock test. NOT in real exam.



Please QuoteYourSources.

Henry
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic