1、Exception和RuntimeException的区别spa
- Exception是RuntimeException的父类,使用了 Exception 的类都必须对异常进行处理(try / throw / throws)
- RuntimeException 能够由选择性的对异常进行处理(能够不处理)
2、常见的 RuntimeException(即RuntimeException的子类)io
- ClassCastException
- FileSystemNotFoundException
- IndexOutOfBoundsException
- NullPointerException