what is a thread pool in java and why is it used?



what is a thread pool in java and why is it used?..

Answer / Avneesh Kumar

A thread pool in Java is a collection of worker threads that can be reused to execute tasks concurrently. By using a thread pool, you can manage the number of threads actively executing tasks at any given time, preventing the creation and destruction of too many threads. This helps reduce the overhead associated with creating new threads, improves performance by minimizing context switching, and promotes efficient resource utilization.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What are the loops in java?

1 Answers  


When a thread is executing a synchronized method , then is it possible for the same thread to access other synchronized methods of an object ?

1 Answers  


Tell me about different OOPS concepts.

1 Answers   Amdocs,


Why java is not a pure object oriented language?

5 Answers   IBM,


why we need this (1.object,2.class,3.data hiding,4.encapsulation,5.abstraction,6. polymorphism,7.inheritance)

2 Answers  


what is difference between prepare stetement and callable starement with example?

1 Answers   CMC,


What is string pool?

1 Answers  


What is the common usage of serialization? What exceptions occur during serialization?

1 Answers  


Explain the difference between an Interface and an Abstract class?

1 Answers   BirlaSoft,


how can u handle run time exception in java? explain with brief explanation with examples?

2 Answers   CTS,


What are different types of multitasking?

1 Answers  


How does finally block differ from finalize() method?

1 Answers  


Categories