MultiThread/src/main/java/thead/thread_5/Application3.java

13 lines
401 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package thead.thread_5;
public class Application3 {
public static void main(String[] args) throws InterruptedException {
MyThread thread = new MyThread();
thread.start();
Thread.sleep(100);
thread.interrupt();
System.out.println("是否中断1" + thread.isInterrupted());
System.out.println("是否中断2" + thread.isInterrupted());
}
}