文章预览
来自:deepinmind的技术博客 链接:http://it.deepinmind.com/java/2014/05/10/common-java-myths.html (点击尾部阅读原文前往) 原文:https://www.javacodegeeks.com/2014/05/common-java-myths.html 下面的这些都算是比较高级的问题了,面试中一般也很少问到,因为它们可能会把面试者拒之门外。不过你可以自己找个时间来实践一下。1、 System.exit(0)会跳过finally块的执行 System.setSecurityManager( new SecurityManager() {
@Override
public void checkExit ( int status) {
throw new ThreadDeath () ;
}
});
try {
System.exit( 0 );
} finally {
System.out.println( "In the finally block" );
} 这段代码为什么会输出In the finally block?为什么没有
………………………………