Javatpoint Logo
Javatpoint Logo

Java ThreadGroup suspend() method

The suspend() method of ThreadGroup class is used to suspend all threads in the thread group.

Syntax

Return

This method does not return any value.

Exception

SecurityException: This exception throws if the current thread is not allowed to access the thread group or any of the threads in the thread group.

Example 1

Test it Now

Output:

Starting of Thread-1
Starting of Thread-2






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