Page 1 of 1

About Question enthuware.ocpjp.v11.2.3637 :

Posted: Thu May 30, 2024 9:40 pm
by gadsgadsx
Won't the es.shutdown() force the last thread (5 thread) to finish?

Re: About Question enthuware.ocpjp.v11.2.3637 :

Posted: Fri May 31, 2024 2:35 am
by exclusivewild
In Java, the behavior of es.shutdown() (where es is an instance of ExecutorService) does not forcefully terminate currently running tasks. Instead, it initiates an orderly shutdown of the ExecutorService in which previously submitted tasks are executed, but no new tasks will be accepted.