Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (10.2k points)

How do you kill a java.lang.Thread in Java?

1 Answer

0 votes
by (46k points)
edited by

Check out thread by Sun on why they deprecated Thread.stop(). It fits into detail on why this was a bad practice and what should be ingested to reliably stop threads in common.

Are you interested in learning Java from the basics! Refer to this video on Java provided by Intellipaat:

The method people recommend is to apply a shared variable as a flag which requires the background thread to stop. This variable can then be incubated by a distinctive object demanding the thread terminate.

Related questions

Browse Categories

...