public class Demo {
public static void main(String[] args) throws Exception {
MyRunnable r = new MyRunnable();
Thread t = new Thread(r);
t.start();
System.out.println("end of method");
}
}
class MyRunnable implements Runnable {
@Override
public void run() {
System.out.println("run");
throw new RuntimeException("problem");
}
}
public class Demo {
public static void main(String[] args) throws Exception {
MyRunnable r = new MyRunnable();
Thread t = new Thread(r);
t.start();
Thread.sleep(10);
System.out.println("end of method");
}
}
class MyRunnable implements Runnable {
@Override
public void run() {
System.out.println("run");
throw new RuntimeException("problem");
}
}
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |