报出这样的错误:
"test.java": Error #: 360 : unreported exception: java.lang.Exception; must be caught or declared to be thrown at line 141, column 11为什么?
"test.java": Error #: 360 : unreported exception: java.lang.Exception; must be caught or declared to be thrown at line 141, column 11为什么?
up;
}catch(散分){
接分;
}
......
if(name.equalsIgnoreCase("a"))
mycode1;
else if (name.equalsIgnoreCase("b"))
mycode2;
else
throw new Exception("类型不匹配");
......
}
try{
myMethod("test");
}catch(Exception e){
}
try{
}catch(Exception e){
}
使用控制异常