Skip to content

Instantly share code, notes, and snippets.

@john-nash-rs
Created April 26, 2020 09:27
Embed
What would you like to do?
private static void demoSupplyAsync() throws InterruptedException, ExecutionException {
CompletableFuture<String> completableFuture = CompletableFuture.supplyAsync(() -> {
System.out.println("Task Running inside completable Future");
return "I am the returned result";
});
String result = completableFuture.get();
System.out.println(result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment