어떤 원인에 의해 오동작 하거나 비정상적으로 종료되는 경우
분류
**exception handling(예외 처리)**이란
public class SimpleException {
public static void main(String[] args) {
int[] intArray = { 10 };
try {
System.out.println(intArray[2]); // 예외가 발생할 수 있는 코드
} catch (ArrayIndexOutOfBoundsException e) { // 단건 예외를 받음
System.out.println("예외 처리 완료"); // 예외 처리 코드
}
System.out.println("프로그램 종료합니다.");
}
}
throw new Exception()