试题答案

3773考试网计算机等级考试试题答案正文

[组图]2009年9月全国计算机等级考试二级Java真题试题

来源:fjzsksw.com 2010-4-7 12:26:17

 

   (11)请在下列程序的空白处,填上适当的内容:
  Import java. awt. *;
  Import java. util. *;
  Class BufferTest{
  Public static void main(string args[])
  Throws IOException{
  FileOutputStream unbuf=
  new FileOutputStream(“test.one”) ;
  BufferedOutputStream buf=
  new  【11】 (new FileOutputStream(“test.two”));
  System.out.println
  (“write file unbuffered: ” + time(unbuf) + “ms”);
  System.out.println
  (“write file buffered: ” + time(buf) + “ms”);
  }
  Static int time (OutputStream  os)
  Throws IOException{
  Date then = new Date();
  for (int  i=0; i<50000; i++){
  os.write(1);
  }
  }
  os.close();
  return(int)(()new Date()).getTime() - then.getTime());
  }
  
  (12)代码System.out.println(066)的输出结果是 【12】 
  
  (13)Swing中用来表示工具栏的类是 javax.swing. 【13】
  
  (14)表达式(10*49.3)的类型是 【14】 型。
  
  (15)抛出异常的语句是 【15】 语句。

 

 

 << 上一页  [11] 

触屏版 电脑版
3773考试网 琼ICP备12003406号-1