exception rethrowing (1) 썸네일형 리스트형 [Java] Exception (re)throwing과 Method throws Declaration 예외 던지기 (Exception Throwing)키워드 throw을 사용하여 프로그래머가 고의로 예외를 발생 시킨 후에 던질수 있다.public class Throw { public static void main(String[] args) { try { Exception e = new Exception("고의로 발생시킨 예외"); // 문자열을 Exception 인스턴스의 message에 저장 throw e; } catch (Exception e) { System.out.println("Error message: " + e.getMessage()); e.printStac.. 이전 1 다음