在千峰第26天
“前进,前进,再前进”
中国加油,武汉加油,千峰加油,我自己加油。
Q11
1、
Throwable
Error
不处理
Exception
2、
Ⅰ已检查、必须
Ⅱ运行时、可处理或可不、
3、
① throw new NullPointerException();
②throw new ClassCastException(“类型转换出错”);
4、
①n=1
main 1
ma1
mb1
Catch EOFException
In finally
main 2
②n=2
main 1
ma1
mb1
Catch IOException
In finally
main 2
③n=3
main 1
ma1
mb1
Catch SQLException
In finally
main 2
④n=4
main 1
ma1
mb1
Catch Exception
In finally
main 2
⑤n=5
main 1
ma1
mb1
ma2
In finally
main 2
7、
class MyException{}
public class TestException {
public static void main(String[] args) {
ma();
}
public static int ma(){
try{
m();
}catch(ArithmeticException e){
System.out.println("ArithmeticException");
}catch(Exception e){
System.out.println("Exception");
}finally{
return 100;
}
}
public static void m(){
throw new ArithmeticException();
}
}
9、
A
11、
①
ma1
ma2 1
In Finally
②
ma1
In Finally
13、
A
14
AB