PoolSize.java Source code

Java tutorial

Introduction

Here is the source code for PoolSize.java

Source

import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class PoolSize {

    public static void main(String[] args) {
        ThreadPoolExecutor executor = new ThreadPoolExecutor(10, 20, 60L, TimeUnit.SECONDS,
                new LinkedBlockingQueue());
        System.out.println(executor.getPoolSize());
    }
}