public ThreadPool(final int max){
  if (max < 1) {
    throw new IllegalArgumentException("Max must be >= 1, instead its:" + max);
  }
  executorService=Executors.newFixedThreadPool(max);
}

public ThreadPool ( final int max ) { if ( max < 1 ) { throw new IllegalArgumentException ( "Max must be >= 1, instead its:" + max ) ; } executorService = Executors . newFixedThreadPool ( max ) ; }
creates a new instance of threadpool max is the maximum number of threads the pool can have . the pool may have fewer threads at any given time .
