相关疑难解决方法(0)

为什么最后在C#中使用?

无论内部最终块是什么(几乎)始终执行,那么将代码封装到其中或将其保持未封闭之间的区别是什么?

c# exception-handling

184
推荐指数
7
解决办法
8万
查看次数

为什么我们使用finally块?

据我所知,以下两个代码片段都将起到同样的作用.为什么要有finally块?

代码A:

try { /* Some code */ }
catch { /* Exception handling code */ }
finally { /* Cleanup code */ }
Run Code Online (Sandbox Code Playgroud)

代码B:

try { /* Some code */ }
catch { /* Exception handling code */ }
// Cleanup code
Run Code Online (Sandbox Code Playgroud)

.net java finally

82
推荐指数
4
解决办法
2万
查看次数

标签 统计

.net ×1

c# ×1

exception-handling ×1

finally ×1

java ×1