Question 1
What does Future.get() do if the task has not yet completed?
A. It blocks the calling thread until the task finishes (or the timeout overload elapses)Correct answer
get() parks the calling thread until the task completes and then returns its result, and the timed overload get(timeout, unit) gives up after the timeout with a TimeoutException.
B. It cancels the task
Cancellation is a separate, explicit call, cancel(mayInterruptIfRunning), not something get() performs.
C. It throws IllegalStateException
Calling get() before completion is the normal, supported pattern, not an illegal state.
D. It returns null immediately
get() never returns a placeholder; a null result only ever means the task itself produced null, such as with submit(Runnable).
Explanation
Future.get() is a blocking call: when the task is not finished it parks the calling thread until completion, then returns the result or throws ExecutionException if the task failed. The timed overload blocks similarly but abandons the wait with a TimeoutException once the deadline passes. This blocking behavior is distinct from isDone(), which returns immediately, and from cancellation, which is a separate explicit call.