Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example where a cached-thread-pool prevents immediate exit of the application
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class CachedThreads {
public static void main(String[] args) {
final ExecutorService executor = Executors.newCachedThreadPool();
executor.submit(() -> System.out.println("Hello World"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment