InterviewSolution
| 1. |
What Is Executors Class? |
|
Answer» Executors class provide factory and utility methods for Executors framework classes LIKE Executor, ExecutorService, ScheduledExecutorService, ThreadFactory, and Callable. THOUGH you can use ThreadPoolExecutor and ScheduledThreadPoolExecutor directly, but the best way to get an executor is to use one of the static factory methods provided by the Executors utility class. Some of the factory methods -
As EXAMPLE - ExecutorService ex = Executors.newFixedThreadPool(2); Executors class provide factory and utility methods for Executors framework classes like Executor, ExecutorService, ScheduledExecutorService, ThreadFactory, and Callable. Though you can use ThreadPoolExecutor and ScheduledThreadPoolExecutor directly, but the best way to get an executor is to use one of the static factory methods provided by the Executors utility class. Some of the factory methods - As example - ExecutorService ex = Executors.newFixedThreadPool(2); |
|