...
source: https://www.baeldung.com/java-completablefuture
Alternatives
Thread
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
int number = 20; Thread newThread = new Thread(() -> { System.out.println("Factorial of " + number + " is: " + factorial(number)); }); newThread.start(); |
...
...
source: https://www.baeldung.com/java-completablefuture
Thread
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
int number = 20; Thread newThread = new Thread(() -> { System.out.println("Factorial of " + number + " is: " + factorial(number)); }); newThread.start(); |
...