This is a custom threadpool.
For more on threadpool you can visit these pages.
Explaination of code.
- The main class creates 4 sample task.
- The sample task sleeps for 2 secs and prints the task number.
- The SIZE reffers to the no. of threads in the threadpool.
- MyThreadPool is the implementation of my custom threadpool.