public class Threads2 implements Runnable {
public void run() {
System.out.println("run.");
throw new RuntimeException("Problem");
}
public static void main(String[] args) {
Thread t = new Thread(new Threads2());
t.start();
System.out.println("End of method.");
}
}
출력을SCJP : 잡히지 않은 예외 후에 프로그램이 종료되지 않습니다.
run.
//exception
로 예측했습니다. 그러나 출력이
run
exception
end of method
run
exception
end of method
(또는)
run
end of method
exception
로 표시됩니다. 예외가 발생하면 끝낼거야, 그렇지?