package com.zhangxueliang.demo.springbootdemo.JUC.c_026_01_ThreadPool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @ProjectName springbootdemo_src
 * @ClassName T05_ThreadPool
 * @Desicription TODO
 * @Author Zhang Xueliang
 * @Date 2019/12/5 15:58
 * @Version 1.0
 **/
public class T05_ThreadPool {

    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(5);
        for (int i = 0; i < 6; i++) {
            executorService.execute(()->{
                System.err.println(Thread.currentThread().getName()+" aaaaa");
            });
        }
        System.err.println(executorService);
        executorService.shutdown();
    }
}

Executors.newFixedThreadPool()使用示例_后台编程