三个线程循环输出十次

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;
	});
}
		```
posted @ 2023-05-08 21:04  fchhk  阅读(9)  评论(0编辑  收藏  举报