This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Thread class Methods 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 class Methods" Watch "Thread class Methods" New topic
Author

Thread class Methods

sharma ishu
Ranch Hand

Joined: Sep 10, 2012
Posts: 70
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?
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4397
    
    8

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

Joined: Sep 10, 2012
Posts: 70
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

Joined: Apr 06, 2010
Posts: 4397
    
    8

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

Joined: Sep 10, 2012
Posts: 70
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.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18876
    
  40

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


Please QuoteYourSources.

Henry
 
GeeCON Prague 2014
 
subject: Thread class Methods