java里的异常分为两种:
checked exception和runtime exception
checked 属于可恢复的异常,继承自exception
而runtime属于不可恢复的异常,继承自RuntimeException
think in java里提到异常可能会被遗漏的情况:
checked exception和runtime exception
checked 属于可恢复的异常,继承自exception
而runtime属于不可恢复的异常,继承自RuntimeException
think in java里提到异常可能会被遗漏的情况:
public static void main(String[] args) {
try{
throw new RuntimeException("hello");
}finally{
}
}
public static void main(String[] args) {
try{
throw new RuntimeException("try");
}finally{
throw new RuntimeException("finally");
}
}