public class CompletableFuture3 { public static void main(String[] args) throws ExecutionException, InterruptedException { // testJoin(); testCompletableException(); } /** * completeExceptionally可以使得get方法不会阻塞,如果future没有完成,那调用get方法会抛出异常 * @throws Exec…