Skip to content

Instantly share code, notes, and snippets.

@jasmine-k
Created March 26, 2018 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasmine-k/0ba4008d95e151dff2183a75d1fa5868 to your computer and use it in GitHub Desktop.
Save jasmine-k/0ba4008d95e151dff2183a75d1fa5868 to your computer and use it in GitHub Desktop.
private static void thenCombine() {
CompletableFuture<String> completableFuture
= CompletableFuture.supplyAsync(() -> "Hello")
.thenCombine(CompletableFuture.supplyAsync(
() -> " Knolders! Its thenCombine"), (value1, value2) -> value1 + value2);
completableFuture.thenAccept(System.out::println); // Hello Knolders! Its thenCombine
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment