单项选择题
现有:
void topGo() {
try {
middleGo();
} catch (Exception e) {
System.out.print("catch");
}
}
void middleGo() throws Exception {
go();
system.out.print("late middle");
}
void go() throws ExceptiOn {
throw new Exception();
}
如果调用 topGo () ,则结果为:()
A. late middle
B. catch
C. late middle catch
D. catch Iate middle
点击查看答案&解析
相关考题
-
单项选择题
现有: class Number{ public static void main(String [] aras) { try { System.out.print (Integer.parselnt ("forty")); } catch (RuntimeException r) { System.out.print ("runtime"); } catch (NumberFormatException e) { system..ut.print("number"); } } } 结果是什么?()
A.number
B.runtime
C.forty number
D.编译失败 -
单项选择题
在方法的声明中,要求该方法必须抛出异常时使用哪个关键字?()
A. throw
B. catch
C. finally
D. throws -
单项选择题
假设有自定义异常类ServiceException,那么抛出该异常的语句正确的是哪项?()
A. raise ServiceException
B. throw new ServiceException()
C. throw ServiceException
D. throws ServiceException
