将尝试/最后(不捕捉)泡沫的例外呢? [英] Will Try / Finally (without the Catch) bubble the exception?

查看:132
本文介绍了将尝试/最后(不捕捉)泡沫的例外呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我几乎可以肯定的是,答案是肯定的。如果我使用try Finally块,但不使用Catch块则任何异常都将泡沫。是否正确?

I am almost positive that the answer is YES. If I use a Try Finally block but do not use a Catch block then any exceptions WILL bubble. Correct?

在一般的做法有什么想法?

Any thoughts on the practice in general?

赛斯

推荐答案

是的,绝对不会。假设你的最后块不抛出异常,当然,在这种情况下,这将有效地取代一个最初抛出。

Yes, it absolutely will. Assuming your finally block doesn't throw an exception, of course, in which case that will effectively "replace" the one that was originally thrown.

这篇关于将尝试/最后(不捕捉)泡沫的例外呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆