Created
July 17, 2020 06:18
-
-
Save PatrickGopher/3ed09ee5924cbbb49a8653eeb9804bb0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final var a = 10; | |
CompletableFuture<Void> future = CompletableFuture | |
.supplyAsync(() -> a * (a + 1)) | |
.exceptionally(ex -> { | |
System.out.println("err: " + ex.toString()); | |
return 0; | |
}) | |
.thenApply(i -> Integer.toString(i)) | |
.thenApply(str -> "\"" + str + "\"") | |
.thenAccept(System.out::println); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment