Javatpoint Logo
Javatpoint Logo

Java forkJoinPool getPoolSize() Method

The getPoolSize() method of ForkJoinPool class is used to get the size of the pool. Size of the pool depends on the number of workers that have started but not yet terminated.

Syntax

Parameter

No parameter is passed.

Returns

The number of worker threads.

Throws

Does not throw the exception.

Example 1

Test it Now

Output:

Common Pool Size before  :0
Common Pool Size after  :1

Example 2

Test it Now

Output:

Pool Size :2
Next TopicJava Forkjoinpool




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials