常见的 Error 和 Exception
生活随笔
收集整理的這篇文章主要介紹了
常见的 Error 和 Exception
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
如下是常見的 Error 和 Exception:
1)運(yùn)行時(shí)異常(RuntimeException)也稱 【非檢查型異常 UncheckedException】:
- Nullpointer Exception:空指針異常;
- ClassCastException:類型強(qiáng)制轉(zhuǎn)換異常
- IllegalArgumentException:傳遞非法參數(shù)異常
- IndexOutOfBoundsException:下標(biāo)越界異常
- NumberFormatException:數(shù)字格式異常
- ArrayIndexOutOfBoundsException: 數(shù)組越界異常
- ArrayStoreException: 數(shù)據(jù)存儲(chǔ)異常,操作數(shù)組時(shí)類型不一致
- ArithmeticException: (算術(shù)異常)
- BufferOverflowException: (緩沖區(qū)溢出異常)
2)非運(yùn)行時(shí)異常(CheckedException)也稱 【檢查型異常】:
- ClassNotFoundException:找不到指定 class 的異常
- IOException:IO 操作異常
- FileNotFoundException:文件不存在異常
- SQLException:SQL語句異常
- InterruptedException: (中斷異常-調(diào)用線程睡眠時(shí)候)
3)錯(cuò)誤(Error):
- NoClassDefFoundError:找不到 class 定義異常
- StackOverflowError:深遞歸導(dǎo)致棧被耗盡而拋出的異常
- OutOfMemoryError:內(nèi)存溢出異常
總結(jié)
以上是生活随笔為你收集整理的常见的 Error 和 Exception的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 中信建投软件测试,中信建投笔试经验-范例
- 下一篇: 权限设计文章汇总