-
Maven - POM Configuration
Before you can use the java concurrent API, you need to add some dependencies to your "pom.xml" file.
Here's the minimal dependencies needed in order for the following examples to work:
-
Example (1): ExecutorService::execute(Runnable)
Output:
-
Example (2) - Synchronous execution: ExecutorService::submit(Callable)
Output:
-
Example (3) - Asynchronous execution: ExecutorService::submit(Callable)
Output: