Practice mode Java

Which Thread method makes the calling thread wait until another thread has finished?

Correct answer A. join()

Explanation

Calling t.join() blocks the current thread until thread t terminates, which provides a simple way to wait for its work. The sleep method pauses for a fixed time regardless of other threads, yield is only a scheduling hint, and notify wakes a thread waiting on a monitor. A timed form of join also exists.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.