Home » Java ThreadGroup stop() method with Examples

Java ThreadGroup stop() method with Examples

by Online Tutorials Library

Java ThreadGroup stop() method

The stop() method of ThreadGroup class is used to stop 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

Test it Now

Output:

Starting of Thread-1  Starting of Thread-2  

You may also like