Skip to main content

Explain thread pools in Java.

Junior Java
Quick Answer Thread pool reuses a fixed number of threads to execute many tasks. Creating a new thread for every task is expensive. ExecutorService manages a pool: submit tasks, threads are reused. Common pools: Executors.newFixedThreadPool(n), newCachedThreadPool(), newSingleThreadExecutor(). Use ThreadPoolExecutor for fine-grained control. Always shut down the executor when done.

Answer

Thread pools reuse worker threads.
Reduce overhead of thread creation.
Executors provide fixed, cached, and scheduled pools.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice