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

Discussion

Which method does Executor declare?

  • A.Thread start(Runnable command)
  • B.void execute(Runnable command)
  • C.Future submit(Runnable command)
  • D.void run(Runnable command)

Answer: B

Executor declares exactly one method, execute, which takes a Runnable and returns nothing. submit belongs to the larger ExecutorService, because returning a Future implies the lifecycle management that Executor deliberately leaves out.

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

Post your comment

Please log in or register to post a comment.