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

Discussion

Which of these does Future declare?

  • A.get, run and stop
  • B.await, cancel and isFinished
  • C.result, abort and done
  • D.get, cancel and isDone

Answer: D

Future exposes get to collect the outcome, cancel to request that the task stop, and the pair isDone and isCancelled to query it without blocking. The names come from the interface rather than from Thread, so run and stop do not appear.

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

Post your comment

Please log in or register to post a comment.