Which method in the ExecutorService interface waits for all tasks to complete after a shutdown request?

  • awaitShutdown()
  • awaitTermination()
  • isTerminated()
  • shutdownNow()
The awaitTermination() method in the ExecutorService interface is used to wait for all tasks to complete after a shutdown request has been made using the shutdown() method. It blocks until all tasks have completed or the specified timeout has passed. The isTerminated() method checks if the ExecutorService has terminated but doesn't wait.
Add your answer
Loading...

Leave a comment

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