怎么做关于易烊千玺的网站郑州网站seo外包公司
文章目录
- finally中的代码一定会执行吗?try里有return,finally还执行么?
- 这道题想考察什么?
- 考察的知识点
- 考生应该如何回答
- 验证
- 特殊情况
- 线程是守护线程
- 遇到System.exit()
finally中的代码一定会执行吗?try里有return,finally还执行么?
这道题想考察什么?
对Java语言的深层次理解,避免在开发时写出"问题"代码
考察的知识点
JM执行流程
考生应该如何回答
在Java官方文档中对finally
的描述如下
The `finally` block *always* executes when the `try` block exits.
大致意思是 : "finally" 块
在 "try" 块
退出时始终执行。
JVM规范里面同样也有明确说明
If the try clause executes a return, the compiled code does the following:
- Saves the return value (if any) in a local variable.
- Executes a jsr to the