当前位置 : 主页 > 编程语言 > java >

Java处理InterruptedException

来源:互联网 收集:自由互联 发布时间:2021-06-28
interrupted_exception try { Thread.sleep(1000);} catch (InterruptedException ex) { Thread.currentThread().interrupt(); throw new RuntimeException(ex);}
interrupted_exception
try {
    Thread.sleep(1000);
} catch (InterruptedException ex) {
    Thread.currentThread().interrupt();
    throw new RuntimeException(ex);
}
网友评论