Which interface provides methods to check if the computation is complete, wait for its completion, and retrieve the result of the computation?

  • CompletionService
  • Executor
  • Future
  • RunnableFuture
The Future interface in Java provides methods to check if a computation is complete, to wait for its completion, and to retrieve the result of the computation. It is commonly used in concurrent programming to manage asynchronous tasks and obtain results when they become available. Executor is not an interface for managing results, and the other options do not provide these specific methods.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *