Once we are done with our tasks given to ExecutorService, then we have to shut it down because ExecutorService performs the task on different threads. If we don't shut down the ExecutorService, the threads will keep running, and the JVM won?t shut down.
The process of shutting down can be done by the following three methods-
shutdown() method
shutdownNow() method
awaitTermination() method