移动端

  • 题王微信公众号

    题王微信公众号

    微信搜“题王网”真题密题、最新资讯、考试攻略、轻松拿下考试

单选题

What is wrong with the following code?()   class MyException extends Exception {}   public class Qb4ab {   public void foo() {  try {  bar();  } finally {  baz();   } catch (MyException e) {}  }   public void bar() throws MyException {   throw new MyException();  }   public void baz() throws RuntimeException {   throw new RuntimeException();   }   }  

发布日期:2021-10-14

What is wrong with the following code?()   class M...
A

Since the method foo() does not catch the exception generated by the method baz(), it must      declare the RuntimeException in its throws clause.

B

A try block cannot be followed by both a catch and a finally block.

C

An empty catch block is not allowed.

D

A catch block cannot follow a finally block.

E

A finally block must always follow one or more catch blocks.

标签: "暂无标签"

题王网让考试变得更简单

扫码关注题王,更多免费功能准备上线!