package jvm.createthread;

import java.util.concurrent.*;

public class CreateByExecutorService {

    public static void main(String[] args) {
        ExecutorService poolA = Executors.newFixedThreadPool(2);
        poolA.execute(() -> {
            System.out.println("poolA");
        });

        poolA.shutdown();

        ThreadPoolExecutor poolB = new ThreadPoolExecutor(2,3,0,
                TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(3),
                Executors.defaultThreadFactory(), new ThreadPoolExecutor.AbortPolicy());

        poolB.submit(() -> {
            System.out.println("poolB");
        });
        poolB.shutdown();

    }


}
