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

Discussion

What does Thread.currentThread() return?

  • A.A long id
  • B.A Thread.State
  • C.A Thread
  • D.A String naming the thread

Answer: C

Correct answer: A Thread

Thread.currentThread() returns the Thread object for the executing thread, from which the name, id, priority and state can then be obtained. It is the usual way of reaching the current thread from code that was not given a reference to it.

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

Post your comment

Please log in or register to post a comment.