Skip to content

Instantly share code, notes, and snippets.

@babjo
Last active November 27, 2017 15:42
Show Gist options
  • Save babjo/f47e971566c1c7335da6b2ac3b24d48c to your computer and use it in GitHub Desktop.
Save babjo/f47e971566c1c7335da6b2ac3b24d48c to your computer and use it in GitHub Desktop.
CompletableFuture<String> completableFuture
= CompletableFuture.supplyAsync(() -> "Hello");
CompletableFuture<Void> future = completableFuture
.thenAccept(s -> System.out.println("Computation returned: " + s));
future.get();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment