感觉很奇怪,希望有人帮我看看。
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; 必须对其进行捕获或声明以便抛出