public class Test {
public static void main(String[] args) {
try {
mm();
System.out.println("kdsjf");
} catch (Exception e) {
System.out.println("Catch");
e.printStackTrace();
} finally {
System.out.println("main finally");
}
}
static void mm() throws Exception {
try {
new Exception();
} finally {
System.out.println("finally");
}
}
}
这是结果:
finally
kdsjf
main finally
为什么catch里的没执行啊?