Machine-translated by Google. Questions are authored in English.
Top

Discussion

What the caller does after start() returns - which of the following is true?

  • A.start() blocks only if the new thread has a higher priority than the caller.
  • B.start() blocks until the new thread reaches its first synchronized block.
  • C.After start() returns, the calling thread continues without waiting for run() to finish.
  • D.start() blocks until the new thread's run() method has completed.

Answer: C

start() returns as soon as the new thread has been created and scheduled; the result is two threads running concurrently, the caller and the new one. Nothing about it waits for run() to finish. Waiting for completion is what join() is for.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.