https://www.bilibili.com/video/BV1Kb411W75N?p=371
一.异常概述:
1)介绍:
a:异常概述与异常体系:
b:常见异常:
c:异常处理机制:try catch finally
d:异常处理机制:throws
e:手动抛出异常:throw
f:用户自定义异常:
二.异常概述与异常体系:
三.异常处理机制:
1)try-catch-finally:
try{
-------
} catch (Exception e ) {
-------
}finally {
-------
}
2)throws:
public void tt(int i) throws Exception{
------
}
四.手动抛出异常:
throw new RuntimeException("111");
五.自定义异常:
public class MyException extends RuntimeException {
public MyException() {
}
public MyException(String msg) {
super(msg);
}
}