第1题
有以下程序源代码: //假设已经有异常类TriangleMinusLengthException和TriangleUnequationException。 public class TestSelfException { public static double calculateArea(double a, double b, double c) throws TriangleMinusLengthException, TriangleUnequationException { if (a<0 || throw new triangleminuslengthexception("负边长异常"); if triangleunequationexception("不满足三角不等式异常"); double p="(a+b+c)/2;" return math.sqrt(p*(p-a)*(p-b)*(p-c)); } public static void main(string[] args) { a="3," b="4," c="5;" e="-4," f="2," g="10000;" try{ area="calculateArea(e," system.out.println("面积:" + area); f, g); }catch(triangleminuslengthexception me){ system.out.println("边长为负,请改正"); }catch(triangleunequationexception ue){ system.out.println("边长不满足三角不等式,请改正!"); 上述语句中,红色显示的函数调用语句执行时,两个catch块都能捕获到相应的异常。(>
第9题
B.try...catch语句处理程序中的bug
C.try...catch语句处理程序中的异常
D.以上说法都不正确
第10题
A、A.try…catch语句处理程序中的错误
B、B.try...catch语句处理程序中的bug
C、C.try...catch语句处理程序中的异常
D、D.以上说法都不正确
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!