【发布时间】:2011-04-27 22:36:02
【问题描述】:
以下处理InterruptedException的方式有什么区别?最好的方法是什么?
try{
//...
} catch(InterruptedException e) {
Thread.currentThread().interrupt();
}
或
try{
//...
} catch(InterruptedException e) {
throw new RuntimeException(e);
}
编辑:我也想知道这两个在哪些场景中使用。
【问题讨论】:
标签: java multithreading exception-handling interrupted-exception