Javatpoint Logo
Javatpoint Logo

Java ThreadGroup enumerate() method

The enumerate() method of ThreadGroup class is used to copy every active thread's thread group and its subgroup into the specified array. This method calls the enumerate method with the tarray argument.

Syntax

Parameter

tarray: It is an array of Thread objects to copy to.

Return

This method returns the number of threads put into the array.

Example

Test it Now

Output:

Starting of Thread-1
Starting of Thread-2
Thread-1 found
Thread-2 found
Thread-2 completed executing
Thread-1 completed executing






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA