checked exception需查异常(需编译器检查)
Exception
自定义XXX
IndexOutOfBoundsException
FileNotFoundException
unchecked exception免查异常(编译器不检查)
RuntimeException
SocketException
内部或资源错误程序无能为力
IOException
通常是代码逻辑bug一定是程序问题
Object
Throwable
NullPointerException
StackOverflowError
LinkageError
Error
OutOfMemoryError
ClassCastException
要么程序无法控制处理,要么是代码逻辑Bug编译器不检查(不应有对其显示处理代码)
代码中需明确throw、catch及处理否则编译直接报错