文章目录
while内try/catch 导致自动清除中断信号
- while内try/catch 导致自动清除中断信号
示例代码如下 while循环内部, 进行了Thread.sleep(10)
的try catch
public class CantInterrupt {
public static void main(String[] args) throws InterruptedException {
Runnable runnable = () -> {
int num = 0;
while ( num
关注
打赏