Skip to content

Instantly share code, notes, and snippets.

@rubykv
Last active April 4, 2022 15:10
Show Gist options
  • Save rubykv/52f4546dd8ebaa7bd7c8fa7c8448d18a to your computer and use it in GitHub Desktop.
Save rubykv/52f4546dd8ebaa7bd7c8fa7c8448d18a to your computer and use it in GitHub Desktop.
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