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

Discussion

What is the return type of isAlive()?

  • A.boolean
  • B.Thread.State
  • C.int
  • D.void

Answer: A

isAlive answers a yes or no question and returns a boolean. getState returns a Thread.State for finer detail, and neither method takes an argument. Confusing the two usually shows up as trying to compare isAlive against a state constant.

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

Post your comment

Please log in or register to post a comment.