0 votes
in Java by

How to stop thread in java? Is there any way to stop thread from inside without a loop? Any way to stop another thread from OUTSIDE of the thread?

I need a proper solution to stop the thread in Java.

1 Answer

0 votes
by (5k points)
There are following way to stop thread:-
    * Run method finishes
    * Call system.exit (this kills your entire process)
    * Call the thread object's interrupt() method

Share:- Whatsapp Facebook Facebook

Welcome to Developerhelpway Q&A, where you can ask questions and receive answers from other members of the community.