5 ms·
CompletableFuture implements Future, so the get method is an implementation of Future.get [1]. Anyway, the major difference is that Future.get throws 2 checked
by kilink 11y ago
CompletableFuture implements Future, so the get method is an implementation of Future.get [1].
Anyway, the major difference is that Future.get throws 2 checked exceptions, InterruptedException and ExecutionException, while CompletableFuture.join does not throw any checked exception. Instead, it wraps any exceptions in CompletionException.
[1] https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html#get() https://docs.oracle.com/javase/7/docs/api/java/util/concurre...