您的位置:首页 > 其它

一些运行时异常及其对应的例子

2017-07-28 14:57 363 查看
1、NullPointException 空指针异常



2、ArithmeticException  数学异常



3、ClassCastException  类型转换异常



4、ArrayIndexOutOfBoundsException 数组下标越界异常



5、StringIndexOutOfBoundsException字符串下标越界



6、IndexOutOfBoundsException  下标越界异常



7、NumberFormatException 数字格式化异常



8、InputMismatchException  输入不匹配异常



9、ArrayStoreException  数组协变异常



10、ConcurrentModificationException   快速报错异常

当打开一个迭代器以后,一直到迭代完毕之前,不能给集合中删除、增加任何元素,否则会抛出该异常。

11、UnsupportedOperationException  不支持该操作异常



12、 NoSuchElementException    没有这么一个元素异常



13、IllegealMonitorStateException  非法监听器状态异常

当在同步块之外,使用锁时,就会抛出,IllegealMonitorStateExecption.  

14、EmptyStackException 空栈异常

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐