Created
June 30, 2020 21:22
-
-
Save theboreddev/9329afb555257d79a4df01775f64e0f7 to your computer and use it in GitHub Desktop.
threads
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Runnable task = () -> { | |
| System.out.println("Async task thread : " + Thread.currentThread().getName()); | |
| System.out.println("EXECUTED!"); | |
| }; | |
| final CompletableFuture<Void> future = CompletableFuture.runAsync(task); | |
| System.out.println("Main thread : " + Thread.currentThread().getName()); | |
| future.join(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment