A.abcdefg
B.abcdefg#
C.abcdefg##
D.##
第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块都能捕获到相应的异常。(>
第2题
有以下程序,程序执行后的输出结果是( )
A、0,1,1,2,
B、1,2,2,3,
C、2,0,3,0,
D、1,0,2,0,
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!