問題文
A Callable throws a checked exception while it runs inside an executor. What does the caller observe when it invokes get on the Future?
選択肢
- An InterruptedException, because the task did not complete normally and the waiting thread is therefore woken up with the interruption signal set on it.
- An ExecutionException whose cause is the exception that the task threw, which the caller reads out of it by calling getCause.
- The original checked exception, rethrown unchanged, and so a calling method must declare that same type.
- A null result, because the exception was already reported on the thread that ran the task and the Future only carries successful outcomes for the caller to read.