Consider the following code:
public class ThreadT implements Runnable {
public void run() {
System.out.println("run.");
throw new RuntimeException("Problem");
}
public static void main(String[] args) {
Thread t = new Thread(new ThreadT());
t.start();
System.out.println("End of method.");
}
}
The output I get is:
End of method.
run.
Exception in thread "Thread-0" java.lang.RuntimeException: Problem
Why the output is not like this:
run.
Exception in thread "Thread-0" java.lang.RuntimeException: Problem
End of method.