J.VI · Java 25 practice question

How does ExecutorService extend the basic Executor interface in the Java SE 25 standard library?

Choose one answer
Check answer and explanation

Correct answer: It adds methods to manage termination and produce Future objects for tracking asynchronous tasks.

Explanation

ExecutorService builds on Executor by providing termination-management methods and methods that return a Future to track the progress of asynchronous tasks.

Common trap

Assuming sequential single-thread execution is tempting because Executors.newSingleThreadExecutor returns an ExecutorService, but the interface itself supports multi-threaded pools like ForkJoinPool and ThreadPoolExecutor. Restricting tasks to virtual threads is tempting in a Java 25 context, yet ExecutorService supports both platform-thread and virtual-thread implementations.

Source: Java SE 25 API: ExecutorService
Checked against the cited text on 2026-11-25.

Report an error in this question