- class Test7 {
- //
- public static void main(String[] args) {
- System.out.println();
- div(10, 0);
- }
- public static void div(int a, int b) {
- int c = 0;
- try {
- c = a / b;
- return;
- }catch(ArithmeticException e){
- e.printStackTrace();
- }finally {
- System.out.println("finally的语句执行了");
- }
- }
- }
复制代码 s很明显是finnally,这是证明过程。
|