tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

[ISSUE] Wrong example code in https://www.baeldung.com/java-completablefuture

Open lovelock opened this issue 1 year ago • 0 comments

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

image

lovelock avatar Aug 16 '24 08:08 lovelock