Home > Java > javaTutorial > body text

Talk about the current status, prospects and opportunities of interrupt threads

巴扎黑
Release: 2017-06-15 15:37:05
Original
1227 people have browsed it

The following example demonstrates how to use the interrupt() method to interrupt a thread and use the isInterrupted() method to determine whether a thread has been interrupted: /* author by w3cschool.cc Main.java */ public class Main extends Object implements Runnable { public void run() { Try { System.out.print

1. Java Example - Interrupt Thread

Talk about the current status, prospects and opportunities of interrupt threads

##Introduction: The following example demonstrates how to use the interrupt() method to interrupt a thread and use the isInterrupted() method to determine whether a thread has been interrupted:

[Related Q&A recommendations]:

Java's interrupt thread interrupt() method, why do we need to finish the run() method? Wouldn't it be meaningless to interrupt the thread?

The above is the detailed content of Talk about the current status, prospects and opportunities of interrupt threads. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template