When using a single-thread executor, what happens if a submitted task throws an exception?

  • The exception is caught, logged, and the executor continues to execute other tasks.
  • The exception is ignored, and the executor continues to execute other tasks.
  • The exception is propagated up the call stack to the caller of the submit() method.
  • The thread running the task is terminated, and the executor replaces it with a new thread.
In a single-thread executor, when a submitted task throws an exception, it is caught and logged, but the executor continues to execute other tasks. The executor does not terminate due to an exception in a single task; it maintains the single thread for execution.
Add your answer
Loading...

Leave a comment

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