程 异常的问题
public class Thread2 implements Runnable {
public void run() {
System.out.println("run");
throw new RuntimeException("Promblem");
}
public static void main(String[] args) {
Thread t = new Thread(new Thread2());
t.start();
System.out.println("end of method");
}
}
可以出现这样的结果:
Exception in thread "Thread-0" java.lang.RuntimeException: Promblem
at Thread2.run(Thread2.java:6)
at java.lang.Thread.run(Unknown Source)
run
end of method
这是为什么啊?