java.util.concurrent · java.base · since Java 1.5
Future
public interface Future<V>A handle to an asynchronous result: blocking get(), cancellation, and state inspection. CompletableFuture extends it with composition.
Key methods
V get() / V get(long timeout, TimeUnit) | Block for the result; task failures arrive wrapped in ExecutionException. |
boolean cancel(boolean mayInterruptIfRunning) | Best-effort cancellation. |
boolean isDone() / isCancelled() | State checks. |
V resultNow() / Throwable exceptionNow() | Non-blocking accessors for completed futures (Java 19). |