请问finally语句还会不会执行?
public class ExceptionTest {
public static void main(String[] args) {
int x = 10;
int y = 0;
try {
System.out.println(x/y);
} catch (ArithmeticException e) {
e.printStackTrace();
//JVM退出了, 地震了
System.exit(0);
} finally {
System.out.println("异常解决");
}
System.out.println("over");
}
} |
|