首页 > 试题广场 >

以下程序运行的输出结果是class Busines

[不定项选择题]
以下程序运行的输出结果是
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 "乐信";
        }
    }
}
  • 捕获SubBusinessException乐信
  • 捕获SubBusinessException桔子
  • 捕获BusinessException乐信
  • 捕获BusinessException桔子

这道题你会答吗?花几分钟告诉大家答案吧!