• 코드:
 
1
public class prog {
2
    static void handlingException() {
3
        try {
4
            throw new Exception();
5
        } catch (Exception e) {
6
            System.out.println("호출된 메소드에서 예외가 처리됨!");
7
        }
8
    }
9
    
10
    public static void main(String[] args) {
11
        try {
12
            handlingException();
13
        } catch (Exception e) {
14
            System.out.println("main() 메소드에서 예외가 처리됨!");
15
        }
16
    }
17
}
표준입력 & 실행옵션