java 分检查异常checked和非检查异常unchecked
非检查异常error类,检查异常Exception
非检查异常error类 outofmemoryerror、stackoverflowerror、linkageerror
检查异常是RuntimeException类
public class Solution {
public static void main(String[] args) {
}
static class MyException extends NoSuchMethodException{
}
static class MyException2 extends ArithmeticException{
}
static class MyException3 extends IOException {
}
static class MyException4 extends RuntimeException {
}
}
参考文档
https://codegym.cc/groups/posts/28-exceptions-checked-unchecked-and-custom