프로그래밍 언어 활용난도 중상
18번 · 주관식 · 5점
다음 Java 프로그램의 실행 결과를 쓰시오.
public class Main {
public static void main(String[] args) {
int sum = 0;
try {
fail();
} catch (NullPointerException e) {
sum += 1;
} catch (Exception e) {
sum += 10;
} finally {
sum += 100;
}
System.out.print(sum);
}
static void fail() throws Exception {
throw new NullPointerException();
}
}