可学答题网 > 问答 > SCJP程序员认证考试题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

static void test() thr


static void test() throws RuntimeException {  try {  System.out.print(”test “);  throw new RuntimeException();  }  catch (Exception ex) { System.out.print(”exception “); }  }  public static void main(String[] args) {  try { test(); }  catch (RuntimeException ex) { System.out.print(”runtime “); }  System.out.print(”end “);  }  What is the result?() 

  • A test end
  • B Compilation fails.
  • C test runtime end
  • D test exception end
  • E A Throwable is thrown by main at runtime.
参考答案
参考解析:
分类:SCJP程序员认证考试题库
相关推荐

1、static void test() thr

static void test() throws Error { if (true) throw new AssertionError(); System.out.print(test )...

2、public static void mai

public static void main(String[] args) { String str = null‟; if (str == null) {&ensp...

3、public static void par

public static void parse(String str) { try { float f= Float.parseFloat(str); } catch (NumberFo...

4、11. public static void

11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Inte...

5、11. public static void

11. public static void test(String str) { 12. if(str == null  str.lellgth() == 0) {&...

6、public static void tes

public static void test(String str) {int check = 4; if (check = str.length()) { System.o...