Types of thread pool
Experienced Java/JavaScript full-stack developer over 6 years of extensive expertise serving key role on elite technical teams developing enterprise software for healthcare, apple ad-platform, banking, and e-commerce. Adaptable problem-solver with high levels of skill in Groovy, Java, Spring, Spring Boot, Hibernate, JavaScript, TypeScript, Angular, Node, Express, React, MongoDB, IBM DB2, Oracle, PL/SQL, Docker, Kubernetes, CI/CD pipelines, AWS, Micro-service and Agile/Scrum. Strong technical skills paired with business-savvy UI design expertise. Personable team player with experience collaborating with diverse cross-functional teams.
- FixedThreadPool: uses a blocking queue to store tasks

- CachedThreadPool: uses a synchronous queue of size 1

- ScheduledThreadPool: uses a delay queue

SingleThreadedExecuter (sequential execution of tasks): uses a blocking queue. The size of the thread pool is 1.
public class ThreadTypesExample { public static void main(String[] args) throws InterruptedException { ExecutorService service = Executors.newSingleThreadExecutor(); for (int i = 0; i < 3; i++) { service.execute(new Task()); } System.out.println("Thread name : " + Thread.currentThread().getName()); } static class Task implements Runnable { @Override public void run() { System.out.println("Thread name : " + Thread.currentThread().getName()); } } } //output Thread name : main Thread name : pool-1-thread-1 Thread name : pool-1-thread-1 Thread name : pool-1-thread-1