public class ExceptionTest {
public String test(int i){
try {
System.out.println("try...");
int result = 1/i;
return "111";
}catch (Exception e){
System.out.println("catch...");
return "444";
}finally {
System.out.println("finally...");
return "333";
}
}
}
public class Test {
public static void main(String[] args) {
ExceptionTest test = new ExceptionTest();
System.out.println(test.test(0));
}
}
求运行结果?
2. Error 和 Exception的区别