具有Java7等价物的编程语言是否尝试多捕获块?

具有Java7等价物的编程语言是否尝试多捕获块?,java,exception,exception-handling,try-catch,java-7,Java,Exception,Exception Handling,Try Catch,Java 7,Java7提供了一种在一个catch块中捕获多个异常的新方法,如下所示 try { //stuff that causes one or more of the exceptions below. } catch (IOException | IllegalArgumentException | IndexOutOfRangeException ex) { //one of the above exceptions was thrown and caught //this

Java7提供了一种在一个
catch
块中捕获多个异常的新方法,如下所示

try
{
    //stuff that causes one or more of the exceptions below.
}
catch (IOException | IllegalArgumentException | IndexOutOfRangeException ex)
{
    //one of the above exceptions was thrown and caught
    //this code block will run if any of the above exceptions was caught
}

还有哪些编程语言(如果有的话)采用类似的方式在一个块中捕获多个异常,或者不需要为每个异常使用
catch
块?这些语言是如何实现对多个异常的捕获的?

Ada编程语言允许捕获多个异常块,但我不知道这是如何实现的-但应该很有兴趣知道,因为Ada是非常强类型的。您可以在这里检查语法:

Javascript要求您在一个
catch
块中捕获所有异常,因为它不是静态类型的。

Scala在
switch
语句中捕获异常我在Python中用抽象基类尝试了这一点,但是我的恶意黑客行为被宣布为非法。这更像是一种强制创新,在某种程度上缓解了JavaAPI对检查异常的过度使用。检查异常非常好,直到每个人都认为它很好并使用它。