题库 软件开发 题目列表 以下程序运行的输出结果是class BusinessException ex...
多选题
以下程序运行的输出结果是
class BusinessException extends Exception{}

class SubBusinessException extends BusinessException{}

public class Test {
    public static void main(String[] args) {
        System.out.print(testException());
    }

    public static String testException() {
        try {
            try {
                throw new SubBusinessException();
            } catch (BusinessException re) {
                return "桔子";
            } finally {
                throw new BusinessException();
            }
        } catch (SubBusinessException re) {
            System.out.print("捕获SubBusinessException");
        } catch (BusinessException re) {
            System.out.print("捕获BusinessException");
        } finally {
            return "乐信";
        }
    }
}
A.

捕获SubBusinessException乐信

B.

捕获SubBusinessException桔子

C.

捕获BusinessException乐信

D.

捕获BusinessException桔子

题目信息
校招真题
-
正确率
0
评论
22
点击