相信你们对异常有了基本的认识了,下面来作一道有意思的面试题:面试
public class TestA {app
@SuppressWarnings("finally")ide
public int myMothod(int a,int b) {spa
try {orm
int m =a/b;ci
return 1;it
} catch (Exception e) {io
System.out.println("抛出异常");class
e.printStackTrace();异常
return 2;
}
finally{
return 3;
}
}
public static void main(String[] args) {
TestA a =new TestA();
int i=a.myMothod(2, 1);
System.out.println(i);
}
}