Home » Java Thread stop() Method with Examples

Java Thread stop() Method with Examples

by Online Tutorials Library

Java Thread stop() method

The stop() method of thread class terminates the thread execution. Once a thread is stopped, it cannot be restarted by start() method.

Syntax

Parameter

obj : The Throwable object to be thrown.

Return

This method does not return any value.

Exception

SecurityException: This exception throws if the current thread cannot modify the thread.

Example

Test it Now

Output:

  

Next TopicJava Thread

You may also like