程序出错时至少需要做的三件事
- Notify the user of an error;
- Save all work;
- Allow users to gracefully exit the program.
Eception的分类
- Throwable
- Error
- Exception
- RuntimeException
- IOException
RuntimeException
A bad cast;
An out-of-bounds array access;
A null pointer access.