【Java】エラーと例外
Javaのエラーと例外
Javaには他言語と異なりException配下に2つの系統があり、Runtime Exception(非検査例外)とその他(検査例外)がある。
Error
このため、catchしても意味がない
- StackOverflowError
- OutOfMemoryError
- ClassFormatError
非検査例外
このため、try-catchは強要されない。
- NullPointerException
- ArrayindexOutOfBoundsException
検査例外
このため、try-catchが強要される。
- IOException
- SQLException