Intellij IDEA Java 7 Multi catch with rethrow Exception

时间:2015-04-13 02:52:58

标签: java eclipse exception intellij-idea rethrow

使用JDK 7编译以下方法时没有任何编译错误;奇怪的是,使用相同JDK 7的Inellij IDEA 14上的相同方法会产生编译错误,但它运行! 这是由于我的IDEA配置错误吗? 谢谢:))

  static void testException() throws FileNotFoundException, SQLException {
    boolean zx = false;
    try {
      if (zx) {
        throw new FileNotFoundException("1");
      }
      else {
        throw new SQLException("2");
      }
    }
    catch (Exception ex) {
      throw (ex);
    }
  }

0 个答案:

没有答案