• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thread question

 
Animesh Shrivastava
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting answers. Question please?
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Animesh Shrivastava
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 848
1
Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In answer two, the start() method has returned; but another thread has been started to execute the run() method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic