This method allows you to specify whether the main thread should be completed if there is no incoming task in the thread for a long time. This is due to another configuration, for example, setCorePoolSize (), setKeepAliveTime (..)
When you create a thread pool and threads exist in the pool, even if the task is not running. It is worth keeping these threads alive. If you want to get them, if you do not have a task to perform this method, it is useful in this case. You need to convey the true value, after which they will die after saving time.
In summary:
allowCoreThreadTimeOut(true)
Shamim ahmmed
source share