在千峰“逆战班”学习的第24天
今天的学习内容是对Map接口遍历的补充,以及异常分类、产生、传递和处理
中国加油!武汉加油!千峰加油!我自己加油!!!
作业:
1.Throwable Error 不能手动处理 Exception
2. I.已检查 必须
II.运行时 可处理可不处理
3.
1) throw new NullPointerException();
2)throw new ClassCastException(“类型转换错误”);
4.
输入1:
main 1
ma1
mb1
Catch EOFException
In finally
main2
输入2:
main 1
ma1
mb1
Catch IOException
In finally
main2
输入3:
main 1
ma1
mb1
Catch SQLException
In finally
main2
输入4:
main 1
ma1
mb1
Catch Exception
In finally
main2
输入5:
main 1
ma1
mb1
mb2
ma2
In finally
main2
7.MyException继承Exception,return 100移动到tyr-catch下面,catch(Exception e)与catch(ArithmeticException e)互换位置,m()方法后面加throws MyException
9.A
11.
读入10时:
ma1
ma2 1
In Finally
读入0时:
ma1
In Finally
13.A
14.AB