
점선 위로는 → 자바가 해놓은 예외처리( 프로그램이 중단되도록 예외처리가 되어있음 )
ArithmeticException (0으로 나눔)NullPointerException (null 객체 참조)IndexOutOfBoundsException (배열/리스트 인덱스 초과)

throw new ArithmeticException("호주머니 사정이 딱하군요!");
new ArithmeticException(...) 객체가 Heap 영역에 생성됨throw 키워드로 인해 현재 메서드 실행은 중단되고 호출한 곳으로 예외가 던져짐catch (ArithmeticException e) { System.out.println(e.getMessage()); }
catch 문의 매개변수 e로 전달됨e.getMessage() 실행 → 예외 메시지 출력⇒ 예외가 발생하면 (throw), 예외 객체가 생성되고, 그 객체가 catch로 전달되어 처리된다.