java线程池等待所有线程结束 java多线程ExecutorService线程数量?

java多线程ExecutorService线程数量?添加了一个新的executors工厂类来生成线程池,如以下方法-public static executors service newfixedt

java多线程ExecutorService线程数量?

添加了一个新的executors工厂类来生成线程池,如以下方法

-public static executors service newfixedthreadpool(int nthreads)

-public static executors service newsinglethreadexecutor()这些方法的返回值是executorservice object,它表示线程池,可以执行由可运行对象或可调用对象表示的线程。它提供以下方法:

-未来<?> submit(可运行任务)

-<T> future<T> submit(可调用<T>任务)