可学答题网 > 问答 > SCJP程序员认证考试题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

Which method implementation


Which method implementations will write the given string to a file named "file", using UTF8 encoding?()   IMPLEMENTATION a:   public void write(String msg) throws IOException {   FileWriter fw = new FileWriter(new File("file"));   fw.write(msg);   fw.close();   }   IMPLEMENTATION b:   public void write(String msg) throws IOException {   OutputStreamWriter osw =  new OutputStreamWriter(new FileOutputStream("file"), "UTF8");  osw.write(msg);   osw.close();   }   IMPLEMENTATION c:   public void write(String msg) throws IOException {  FileWriter fw = new FileWriter(new File("file"));   fw.setEncoding("UTF8");   fw.write(msg);   fw.close();  }   IMPLEMENTATION d:   public void write(String msg) throws IOException {  FilterWriter fw = FilterWriter(new FileWriter("file"), "UTF8");   fw.write(msg);  fw.close();   }   IMPLEMENTATION e:   public void write(String msg) throws IOException {   OutputStreamWriter osw = new OutputStreamWriter(  new OutputStream(new File("file")), "UTF8"  );   osw.write(msg);   osw.close();   }  

  • AImplementation a.
  • BImplementation b.
  • CImplementation c.
  • DImplementation d.
  • EImplementation e.
参考答案
参考解析:
分类:SCJP程序员认证考试题库
相关推荐

1、Which two methods, ins

Which two methods, inserted independently at line 17, correctly complete the Sales class?()Adouble&e...

2、Which naming method us

Which naming method uses the tnsnames.ora file to store the connect descriptor used by the&ensp...

3、Which five methods,inserted

Which five methods,inserted independently at line 5,will compile?()Apublic int blipvert(int x){return 0...

4、Given: Which three methods

Given:Which three methods, inserted individually at line 14, will correctly complete class Two?()Ai...

5、Given: Which five methods,

Given:Which five methods, inserted independently at line 5, will compile?()Apublic int blipvert(int&ens...

6、Which method could be&

Which method could be utilized to identify both DML operations and the SQL statements needed&en...