black

Java认证考试综合练习

登录

多项选择题

现有  
1. class Calc { 
2.  public static void main(String [] args) {  
3.    try { 
4.         int x = Integer.parselnt ("42a") ;  
5.     //insert code here 
6.         System.out.print ("oops");  
7.    }  
8.   }  
9. } 
 下面哪两行分别插入到第五行,会导致输 "oops" ? () 

A. } catch (IllegalArgumentException e) {
B. } catch (IllegalStateException c) {
C. } catch (NumbelFormatException n) {
D. } catch (ClassCastException c) {

相关考题

单项选择题 现有:  void topGo()  {      try  {  middleGo();  }  catch  (Exception e)  {      System.out.print("catch");      }      }  void middleGo()  throws Exception  {     go();  system.out.print("late middle");     }  void go()  throws ExceptiOn  {     throw new Exception();     } 如果调用 topGo () ,则结果为:()

单项选择题 现有:  class Number{  public static void main(String  []  aras)  {      try  {  System.out.print (Integer.parselnt ("forty"));      } catch (RuntimeException r)  {      System.out.print ("runtime");  } catch  (NumberFormatException e)  {      system..ut.print("number");      }      }      }  结果是什么?()

单项选择题 在方法的声明中,要求该方法必须抛出异常时使用哪个关键字?()

All Rights Reserved 版权所有©计算机考试题库(jsjtiku.com)

备案号:湘ICP备14005140号-4

经营许可证号:湘B2-20140064