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

Swing中用来表示表格的类是javax.swing.__________。

答案解析

JTable

关键词

swing;java;程序;设计;表格;

Swing 中的按钮类是javax.swing.__________。

Swing与AWT相比新增的布局管理器是【 】。

在对象流中,对象的传送首先要将所传送的对象串行化,也就是实现Serializable接口。以下代码中必须要实现Serializable接口的类是__________。ObjectInput in=new ObjectInputStream(new FileInputStream("employee. dat"));Employee[] newStaff=(Employee[])in. readObject();

Java中的抽象类Reader和Writer所处理的流是【 】。

在Java中,“目录”被看作是【 】

在Java 中,对象流以____________方法传送和存储。

Java 输入/输出流中包括字节流、____________、文件流、对象流以及管道流。

下列程序的运行结果是 【 】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”);         }     } }

下列代码的执行结果是 【 】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");             }         }     } }

在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");   } }