示例代碼:
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
示例代碼:
public void sleep() throws InterruptedException {
Thread.sleep(1000);
}
示例代碼:
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
示例代碼:
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// do nothing
}