<分区>
try {
if (check) {
while (true) ;
} else {
System.exit(1);
}
} finally {
clear();
}
问:是否存在 clear()
永远不会执行的情况?
我个人觉得没有不执行clear()的情况。
标签 java
<分区>
try {
if (check) {
while (true) ;
} else {
System.exit(1);
}
} finally {
clear();
}
问:是否存在 clear()
永远不会执行的情况?
我个人觉得没有不执行clear()的情况。
最佳答案
如果 System.exit
成功,则 clear()
将不会被执行。然而,System.exit(1)
could throw SecurityException
exception , 在这种情况下 clear()
将被执行。
关于java - 代码永远无法清除的情况(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13161835/