/ 知识库     / 试卷库

填空题(2011年3月二级考试)

Java的类库中提供Throwable类来描述异常,它有Error和  __________ 两个直接子类。

答案解析

Exception

关键词

子类;异常;java;线程;程序;设计;throwable;描述;error;线程的概念;

在oneMethod()方法运行正常的情况下,程序段将输出什么? public void test(){   try{    oneMethod();    System.out.println("condition 1");   }catch(ArrayIndexOutOfBoundsException e){    System.out.println("condition 2");   }catch(Exception e){    System.out.println("condition 3");   }finally{    System.out.println("finally");   } }

下列代码的执行结果是 【 】public class Test {     public static void main(String[] args){         int[] x={0,1,2,3};         for(int i=0;i<3;i+=2){             try{                 System.out.println(x[i+2]/x[i]+x[i+1]);             }catch(ArithmeticException e){                 System.out.println("error1");             }catch(Exception e){                 System.out.println("error2");             }         }     } }

下列程序的运行结果是 【 】public class test{     private String[] data={“10”,“10.5”};     public void fun(){         double s=0;         for(int i=0;i<3;i++){             try{                 s=s+Integer.parseInt(data[i]);             }catch(Exception e){                 System.out.print(“errorl:”+data[i]);             }         }     }     public static void main(String[] args){         try{             testd=new test();             d.fun();         }catch(Exception e){             System.out.printIn(“error2”);         }     } }

Java的类库中提供Throwable类来描述异常,它有Error和 __________ 两个直接子类。

Java的类库中提供Throwable类来描述异常,它有Error和 __________ 两个直接子类。

Java的类库中提供Throwable类来描述异常,它有Error和 __________ 两个直接子类。

Java的类库中提供Throwable类来描述异常,它有Error和 __________ 两个直接子类。

Java的类库中提供Throwable类来描述异常,它有Error和 __________ 两个直接子类。

Java的类库中提供Throwable类来描述异常,它有Error和 __________ 两个直接子类。

Java的类库中提供Throwable类来描述异常,它有Error和 __________ 两个直接子类。