
사용자 정의 예외를 구현해서 처리할 수도 있다.

try 블록에서 return 문을 사용해서 finally 블록은 실행된다.

throws는 예외를 떠넘기기 위해 사용된다.

예외를 호출한 곳으로 떠넘기기 위해 메소드 선언부에 작성되는 것은 throws이다.

상위 예외 객체(Exception)을 하위 예외 객체(ClassNotFoundException) 위에 작성하면 안 된다.

10
숫자로 변환할 수 없음
10
인덱스를 초과했음
10


super(message);
super(message);
throws NotExistIDException, WrongPasswordException
throw new NotExistIDException("아이디가 존재하지 않습니다.");
throw new WrongPasswordException("패스워드가 틀립니다.");


try(FileWriter fw = new FileWriter("file.txt")) {
fw.write("Java");
} catch (IOException e) {
e.printStackTrace();
}