Exception—异常
ClassCastException 类型转换异常
NullPointerException 空指针异常
Array Index Out Of Bounds Exception 数组下标越界异常
Arithmetic Exception 算术异常
ArrayStore Exception 数组中包含不兼容的值拋出的异常
NumberFormatException 字符串转换为数字抛出的异常
IllegalArgumentException 非法参数异常
FileSystem NotFound Exception 文件系统未找到异常
SecurityException 安全性异常
String Index Out Of Bounds Exception 字符串索引超出范围抛出的异常
Negative ArraySize Exception 数组长度为负异常
常见的非运行时异常(必须使用try…catch代码进行处理,或用throws关键字抛出)
ClassNotFoundException 未找到相应类异常
SQLException 操作数据库异常类
IOException 输入/输出流异常
TimeeoutException 操作超时异常
FileNotFoundException 文件未找到异常
getMessage( )方法:获取有关异常事件的信息。
toString( )方法:获取异常的类型与性质。
printStackTrace( )方法:获取异常事件发生时执行堆浅的内容。