tutorials
tutorials copied to clipboard
[ISSUE] Wrong example code in https://www.baeldung.com/java-completablefuture
Article and Module Links https://www.baeldung.com/java-completablefuture
Describe the Issue
CompletableFuture<String> completableFuture
= CompletableFuture.supplyAsync(() -> "Hello")
.thenCombine(CompletableFuture.supplyAsync(
() -> " World"), (s1, s2) -> s1 + s2));
There should not be the last close parentheses.
Expected Behavior
CompletableFuture<String> completableFuture
= CompletableFuture.supplyAsync(() -> "Hello")
.thenCombine(CompletableFuture.supplyAsync(
() -> " World"), (s1, s2) -> s1 + s2);
Screenshots