多做题,通过考试没问题!

Java认证考试

睦霖题库>其他计算机考试>Java认证考试

The file “file.txt” exists on the file system and contsins ASCII text.  Given:   try {   File f = new File(“file.txt”);    OutputStream out = new FileOutputStream(f, true);   }    catch (IOException) {}   What is the result?()

  • A、 The code does not compile.
  • B、 The code runs and no change is made to the file.
  • C、 The code runs and sets the length of the file to 0.
  • D、 An exception is thrown because the file is not closed.
  • E、 The code runs and deletes the file from the file system.
正确答案:A
答案解析:
进入题库查看解析

微信扫一扫手机做题