http://www.verejava.com/?id=16992977771679
package com.exception;
public class TestException2 {
public static void main(String[] args) {
for (int i = 0; i < 10; i++) {
System.out.println(i);
//程序 休眠 1 秒钟=1000 毫秒
//编译期的异常, 编译期的异常,是我们必须捕获 必须要放在 try{}catch{}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}