下列代码说法正确的是( )

public class Foo extends Super {
    public static void main(String[] args) {
        try {
            return;
        } finally {
            System.out.println("Finally");
        }
    }
}

A. 什么也不输出 B. 输出 Finally C. 编译错误 D. 以上说法都不正确

参考解答

B

分析

finally{} 无论有无异常都会执行,所以会输出Finally,选择B项。


results matching ""

    No results matching ""