Last active
April 4, 2022 15:10
-
-
Save rubykv/52f4546dd8ebaa7bd7c8fa7c8448d18a 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
public static void main(String[] args) throws InterruptedException, ExecutionException { | |
CompletableFuture<Integer> cf = CompletableFuture.supplyAsync(() -> { | |
return 1; | |
}); | |
System.out.print("Result " + cf.thenApply((x) -> { | |
return x + 2; | |
})); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment