相关疑难解决方法(0)

finally块有什么意义?

除了语法之外,有什么区别

try {
}
catch() {
}
finally {
    x = 3;
}
Run Code Online (Sandbox Code Playgroud)

try {
}
catch() {
}

x = 3;
Run Code Online (Sandbox Code Playgroud)

编辑:在.NET 2.0中?


所以

try {
    throw something maybe
    x = 3
}
catch (...) {
    x = 3
}
Run Code Online (Sandbox Code Playgroud)

在行为上是等同的吗?

.net design-patterns exception try-catch-finally

30
推荐指数
5
解决办法
4249
查看次数