Created
April 26, 2020 09:27
-
-
Save john-nash-rs/f87300895fd8c46c5905c2a0a158bac4 to your computer and use it in GitHub Desktop.
This file contains 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
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