智慧职教: 下列程序运行后输出的结果是___________。 public class MyException { public static void main (String[] args) { try{ throw new Throwable() ; } catch (Throwable e) { System. out. print (e. getMessage()) ; } } }
举一反三
- class MyException extends (1) { } public class Demo { public static void main(String[] args) { try { show(); } catch ( (2) e) { e.printStackTrace(); } } public static void show() (3) MyException { throw new MyException(); } 以上程序,创建了一个自定义异常(编译异常),请补全空白处代码
- 智慧职教: 阅读下列代码public class Person{ static int arr[ ] = new int[10]; public static void main(String args) { System. out. println(arr[9]) ; }}该代码的运行结果是_________。
- public class Test { public static void main(String[] args) { String s1 = "abc"; String s2 = new String ("abc"); System.out.println(s1 == s2); } } 程序运行结果是
- 下列程序的运行结果是()public class Test {public static void main(String[] args) {String str = NULL;System.out.println(str);}} A:
- 智慧职教: 现有: 1. class Birds { 2. public static void main (String [] args) { 3. try { 4. throw new Exception () ; 5. } catch (Exception e) { 6. try { 7. throw new Exception () ; 8. } catch (Exceptio