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

Discussion

Which overloads of join does Thread provide?

  • A.join(Thread) and join(Thread, long) only
  • B.join(long, TimeUnit) only
  • C.join(), join(long) and join(long, int)
  • D.join() and join(Thread) only

Answer: C

Correct answer: join(), join(long) and join(long, int)

The three take no timeout, a timeout in milliseconds, and a timeout in milliseconds plus nanoseconds. All are instance methods called on the thread to be waited for, which is why there is no overload taking a Thread argument - the thread is the receiver.

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

Post your comment

Please log in or register to post a comment.