异常的类型catch中不同的Exception

FileReader的对象   FileNotFoundException

错误传递给构造方法一个null,构造方法将抛出一个NullPointException空指针异

构造方法初始化了一个文件输出流,如果这个文件不打开,这个构造方法将抛出一个IOException

ArrayList类的get方法,如果 i 参数值小于0或者大于SIZE,将抛出一个IndexOutOfBoundsException异常。

SQLException 

5 常见异常
算术异常类:ArithmeticExecption


空指针异常类:NullPointerException


类型强制转换异常:ClassCastException


数组负下标异常:NegativeArrayException


数组下标越界异常:ArrayIndexOutOfBoundsException


违背安全原则异常:SecturityException


文件已结束异常:EOFException


文件未找到异常:FileNotFoundException


字符串转换为数字异常:NumberFormatException


操作数据库异常:SQLException


输入输出异常:IOException


方法未找到异常:NoSuchMethodException


ClassCastException(类型转换异常), IllegalArgumentException(非法计算异常), IndexOutOfBoundsException(下标越界异常),NoSuchElementException(没有这样的元素异常), NullPointerException(空指针异常), RasterFormatException, SecurityException, SystemException(系统出现的异常)

RuntimeException
ArithmeticException, ArrayStoreException, BufferOverflowException, BufferUnderflowException, CannotRedoException, CannotUndoException, ClassCastException, CMMException, ConcurrentModificationException, DOMException, EmptyStackException, IllegalArgumentException, IllegalMonitorStateException, IllegalPathStateException, IllegalStateException, ImagingOpException, IndexOutOfBoundsException, MissingResourceException, NegativeArraySizeException, NoSuchElementException, NullPointerException, ProfileDataException, ProviderException, RasterFormatException, SecurityException, SystemException, UndeclaredThrowableException, UnmodifiableSetException, UnsupportedOperationException


你可能感兴趣的:(异常的类型catch中不同的Exception)