Question
In Java, which comparison about ExecutorService, Future, and CompletableFuture is accurate?
- Future mainly exposes pending completion, while CompletableFuture supports non-blocking chaining, combination, and callbacks.
- There is no practical difference in behavior, performance, or API design when ExecutorService, Future, and CompletableFuture is involved.
- The oldest option related to ExecutorService, Future, and CompletableFuture is always the right production choice regardless of context.
- Differences around ExecutorService, Future, and CompletableFuture are mostly cosmetic, so correctness and maintainability do not change.
Hint
Focus on the behavior or tradeoff, not just the keyword.
Answer and rationale
Correct answer: A. Future mainly exposes pending completion, while CompletableFuture supports non-blocking chaining, combination, and callbacks.
Future mainly exposes pending completion, while CompletableFuture supports non-blocking chaining, combination, and callbacks. This is the comparison that usually separates memorization from understanding.
Track: Java