感觉很奇怪,希望有人帮我看看。
iaiti Java领域优质创作者 博客专家认证 2012-08-22 10:30:18 public class TestThrows{
void regist(int number) throws Exception{
if (number < 0){
throw new Exception("人数为负");
}
}
public static void main(String[] args){
TestThrows t = new TestThrows();
t.regist(-4);
}
}TestThrows.java:41: 错误: 未报告的异常错误Exception; 必须对其进行捕获或声明以便抛出