Java

Throwable 클래스란?

Junuuu 2023. 6. 16. 00:01
반응형

개요

Exception에 대해 알아보던 중 CheckedException, UnCheckedException으로만 구분 짓곤 했었는데, Throwable이란 클래스가 종종 보이게 되어 확실하게 정리하고자 합니다.

 

Throwable 클래스란?

https://codedragon.tistory.com/4447

Throwable은 Java 언어의 모든 오류(Error Class) 및 예외(Exception Class)의 최상위(root) 클래스입니다.

 

Error는 프로그램의 회복을 기대하지 않는 치명적인 예외입니다.

예를 들어 IOError, OutOfMemoryError 등이 있습니다.

 

Exception은 프로그램 회복을 기대하는 예외입니다.

IOException, RuntimeException 등이 있습니다.

 

 

 

 

참고자료

https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html

 

Throwable (Java Platform SE 8 )

Provides programmatic access to the stack trace information printed by printStackTrace(). Returns an array of stack trace elements, each representing one stack frame. The zeroth element of the array (assuming the array's length is non-zero) represents the

docs.oracle.com