后两个是在JDK1.4中新出现的方法,用来支持所谓的链式违例(chained exception)机制(4)。接着,我们来看看throwable的一些主要方法:
基于1个网页-相关网页
A chained exception is one that allows you to attach a "causative" exception to the exception being thrown.
一个链式异常是这样一种异常,它允许您将一个“成因”异常附加到正在抛出的异常。
The code in Listing 1 is fairly straightforward; we've simply chained together multiple exceptions to create a single, nested exception.
清单1中的代码很简单;我们已经简单地将多个异常“串”在一起,以创建单个、嵌套的异常。
应用推荐