Thread is one of important Class in Java and multi-threading is most widely used feature,but there is no clear way to stop Thread in Java. Earlier there was a stop method exists in Thread Class but Java deprecated that method citing some safety reason. By default a Thread stops when execution of run() method finish either normally or due to any Exception.In this article we will How to Stop Thread in Java by using a boolean State variable or flag. Using flag to stop Thread is very popular way of stopping thread and its also safe, because it doesn't do anything special rather than helping run() method to finish it self.
How to Stop Thread in Java Code Example
Read more »
0 Response to "How to Stop Thread in Java Code Example"
Posting Komentar