File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Thread question" Watch "Thread question" New topic
Author

Thread question

Animesh Shrivastava
Ranch Hand

Joined: Jul 19, 2004
Posts: 298
In the khalid mughal's mock exam section, there is a question:

Select the one correct answer.
1) The run() method that the thread is executing ends
2) The call to the start() method of the Thread object returns
3) The suspend() method is called on the Thread object
4) The wait() method is called on the Thread object

1 is the correct answer
I agree 1 is the correct answer but why couldnt 2 be also the correct answer?

Please anyone explain me.

Thanks
Stephen C Johnson
Greenhorn

Joined: Mar 07, 2005
Posts: 7
Interesting answers. Question please?
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
I'd say they are all correct answers to some question.

As this is not Jeopardy I'm not going to guess at what those questions actually are.


42
Animesh Shrivastava
Ranch Hand

Joined: Jul 19, 2004
Posts: 298
Sorry for the wrongly posted question,
here is the right one:

Under which circumstance will a thread stop
Select the one correct answer.
1) The run() method that the thread is executing ends
2) The call to the start() method of the Thread object returns
3) The suspend() method is called on the Thread object
4) The wait() method is called on the Thread object

The correct answer given is 1,
i expected 2 to be the correct one
Peter Rooke
Ranch Hand

Joined: Oct 21, 2004
Posts: 801

In answer two, the start() method has returned; but another thread has been started to execute the run() method.


Regards Pete
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Thread question
 
Similar Threads
Ambiguous question on thread?
about wait() method
a thread stops
Marcus Green #3, Q44
about wait() method