Java 8 CompletableFuture thenRun Example

Yatin B.Yatin B.
1 min read

Date: 2021-12-06

This tutorial demonstrates Java 8's CompletableFuture.thenRun() method. Unlike other CompletableFuture methods, thenRun() doesn't take a result from a previous stage and doesn't return a value; it simply executes a given runnable task after a CompletableFuture completes. The example shows a basic implementation and its output. The article assumes familiarity with Java 8 and an IDE.

Read more: https://examples.javacodegeeks.com/java-8-completablefuture-thenrun-example/

0
Subscribe to my newsletter

Read articles from Yatin B. directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Yatin B.
Yatin B.