?? interruptcheck.java
字號:
public class InterruptCheck extends Object {
public static void main(String[] args) {
Thread t = Thread.currentThread();
System.out.println("Point A: t.isInterrupted()=" + t.isInterrupted());
t.interrupt();
System.out.println("Point B: t.isInterrupted()=" + t.isInterrupted());
System.out.println("Point C: t.isInterrupted()=" + t.isInterrupted());
try {
Thread.sleep(2000);
System.out.println("was NOT interrupted");
} catch ( InterruptedException x ) {
System.out.println("was interrupted");
}
System.out.println("Point D: t.isInterrupted()=" + t.isInterrupted());
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -