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

13 lines
401 B
Java
Raw Normal View History

2024-12-28 16:21:45 +08:00
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());
}
}