给定如下Java代码片段 则下列调用方法正确的是()。 Public int count (int i) throws Exception {
已帮助 人
给定如下Java代码片段,则下列调用方法正确的是()。 Public int count (int i) throws Exception { if (i==0) throw new Exception(“参数不正确!”); return 20/i; }
A.public void useCount(){ count(0); }
B.public void useCount() throws Exception{ count(0); }
C.public void useCount(){ try { count(10); }catch(ArithmeticException e){} }
D.public void useCount(){ try{ count(10); } }

