for (int i = 0; i < 10; i++) {
CompletableFuture<Void> cf1 = CompletableFuture.supplyAsync(() -> {
System.out.println("A");
return null;
});
CompletableFuture<Integer> cf2 = cf1.thenApply((result) -> {
System.out.println("B");
return null;
});
CompletableFuture<Integer> cf3 = cf2.thenApply((result) -> {
System.out.println("C");
return null;
});
}
```
三个线程循环输出十次
发布时间 2023-05-08 21:08:38作者: fchhk