中国大学MOOC: 下面代码中,第7行横线处应该填入class MyExcept {};int main() { try { MyExcept ex; throw ex; } catch (________) { } return 0;}
举一反三
- 下面代码中,第7行横线处应该填入class MyExcept {}; int main() { try { MyExcept ex; throw ex; } catch (________) { } return 0; } A: MyExcept &e B: MyExcept *e C: MyExcept ~e D: std::exception e E: std::exception &e
- 下面代码中,第7行横线处应该填入class MyExcept {}; int main() { try { MyExcept ex; throw ex; } catch (________) { } return 0; } A: MyExcept &e B: MyExcept *e C: MyExcept ~e D: std::exception e E: std::exception &e
- Java中,下面捕获异常的语句不正确的是( )。 A: try{……}finally{……} B: try{……}catch(Exception ex){……} C: try{ try{……}}catch(Exception ex){……} D: try{ try{……} finally{……}}catch(Exception ex){……}
- 读程序,写出和程序输出格式一致的输出结果。 public class J_Test { public static void mb_method(int i) { try { if(i == 1) throw new Exception(); System.out.print("1"); } catch(Exception ex) { System.out.print("2"); return; } finally { System.out.print("3"); } System.out.print("4"); } public static void main(String[] args) { mb_method(0); mb_method(1); } }
- 中国大学MOOC: 对于下面的代码,说法正确的是class A {public: A(int a = 0) { x = a; } static void f1() { y++; };private: int x; static int y;}; int main() { A::f1(); return 0;}