class p16 extends Tire{
public static void main(String[] args){
new p16().doStuff();
}
// insert code here -->line 10
System.out.println(7/0);
}
}class MyException extends Exception{}
class Tire{
void doStuff(){}
}And given the following four code fragments:
1.void doStuff(){2.void doStuff() throws MyException{3.void doStuff() throws RuntimeException{4.void doStuff() throws ArithmeticException{
When fragments 1-4 are added, independently, at line 10, which are true?(choose all that apply)A. None will compileB. They will all compileC. Some, but not all, will compileD. All of those that compile will throw an exception at runtimeE. None of those that compile will throw an exception at runtimeF. Only some of those that compile will throw an exception at runtime答案为 C D答案C可以理解。
但是不明白D,或许我没有理解D答案的意思
请各位高手指教
解决方案 »
- Invalid property 'allcountService' of bean class [com.lsxy.action.UserOperAction
- JAVA写的单件模式
- 找不到符号 符号:构造函数lady(java.lang.String,Cat) 类:lady Lady l1 = new Lady("mimi",c);)
- 郁闷的面试题
- 需要把文章内容的单引号‘换成2个单引号‘‘, 或者 \‘(转义符)
- 帮助解释求素数的程序
- 请问如何能使所画的文字居右对齐?
- 面试题求解!!!!!!!!!!!!
- JAVA怎样生成EXE文件?
- final 与static
- 进行C/S界面设计,如何选择工具?
- 麻烦大家看看下面那个字符串怎么转化,谢谢了
2 无法通过编译 重写的方法不能抛出更多非运行时异常
3 能通过编译 但是运行时抛异常
4 能通过编译 ArithmeticException extends RuntimeException
但是运行时抛异常
意思是所有编译通过的程序在运行时会抛出异常。7/0异常。