给定如下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); } }

给定如下Java代码片段 则下列调用方法正确的是()。 Public int count (int i) throws Exception {

热搜:java构造方法何时被调用