Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumJavaExecutorService usageSingle-choice MCQ

A fixed thread pool is created with an unbounded task queue. What happens when shutdown() is called while many tasks are still queued, and then a new task is submitted?

ExecutorService pool = Executors.newFixedThreadPool(4); // ... thousands of tasks already submitted and queued ... pool.shutdown(); pool.submit(extraTask); // submitted AFTER shutdown()