62,614
社区成员
发帖
与我相关
我的任务
分享
public class BadTimerTest{
public static void main(String[] args) {
Timer timer = new Timer();
timer.schedule(new RuntimeExcepTask(), 1);
Thread.sleep(1000);
timer.schedule(new new RuntimeExcepTask(), 1);
Thread.sleep(1000);
}
static class RuntimeExcepTask extends TimerTask {
publi void run {throw new RuntimeException(); }
}
}