I am creating a new Thread from the main thread using the below:
public static void main(String[] args) {
try {
new TestThread().start();
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("Inside main");
}
And throwing an exception. I am able to catch it in the main thread also.But according to article
this shouldn't be the case right?
EDIT:
public class TestThread extends Thread {
@Override
public void run() {
throw new RuntimeException();
}
}
Exception Trace
Inside main
Exception in thread "Thread-0" java.lang.RuntimeException
at TestThread.run(TestThread.java:8)