网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

Whichmethodimplementationswillwritethegivenstringtoafilenamed"file",usingUTF8encoding?()

IMPLEMENTATIONa:

publicvoidwrite(Stringmsg)throwsIOException{

FileWriterfw=newFileWriter(newFile("file"));

fw.write(msg);

fw.close();

}

IMPLEMENTATIONb:

publicvoidwrite(Stringmsg)throwsIOException{

OutputStreamWriterosw=newOutputStreamWriter(newFileOutputStream("file"),"UTF8");osw.write(msg);

osw.close();

}

IMPLEMENTATIONc:

publicvoidwrite(Stringmsg)throwsIOException{FileWriterfw=newFileWriter(newFile("file"));

fw.setEncoding("UTF8");

fw.write(msg);

fw.close();}

IMPLEMENTATIONd:

publicvoidwrite(Stringmsg)throwsIOException{FilterWriterfw=FilterWriter(newFileWriter("file"),"UTF8");

fw.write(msg);fw.close();

}

IMPLEMENTATIONe:

publicvoidwrite(Stringmsg)throwsIOException{

OutputStreamWriterosw=newOutputStreamWriter(newOutputStream(newFile("file")),"UTF8");

osw.write(msg);

osw.close();

}


参考答案

更多 “ Whichmethodimplementationswillwritethegivenstringtoafilenamedfile,usingUTF8encoding?()IMPLEMENTATIONa:publicvoidwrite(Stringmsg)throwsIOException{FileWriterfw=newFileWriter(newFile(file));fw.write(msg);fw.close();}IMPLEMENTATIONb:publicvoidwrite(Stringmsg)throwsIOException{OutputStreamWriterosw=newOutputStreamWriter(newFileOutputStream(file),UTF8);osw.write(msg);osw.close();}IMPLEMENTATIONc:publicvoidwrite(Stringmsg)throwsIOException{FileWriterfw=newFileWriter(newFile(file));fw.setEncoding(UTF8);fw.write(msg);fw.close();}IMPLEMENTATIONd:publicvoidwrite(Stringmsg)throwsIOException{FilterWriterfw=FilterWriter(newFileWriter(file),UTF8);fw.write(msg);fw.close();}IMPLEMENTATIONe:publicvoidwrite(Stringmsg)throwsIOException{OutputStreamWriterosw=newOutputStreamWriter(newOutputStream(newFile(file)),UTF8);osw.write(msg);osw.close();} ” 相关考题
考题 有限空间作业使用超过安全电压的手持电动工具,应配备漏电保护器。() 此题为判断题(对,错)。

考题 实用的网络程序最少需要几个线程?() A.两个线程,一个线程等待网络消息,另一个线程处理用户动作B.一个线程即可C.三个线程,一个线程作为服务器端,第二个线程作为客户端,第三个线程响应用户动作D.四个线程,一个线程作为服务器端,第二个线程作为客户端,第三个线程作为数据传输,第四各线程响应用户动作

考题 下面是路由器RTD的部分输出信息,关于输出信息描述正确的是?() A.该接口使能的IGMP版本是版本1B.改接口的IGMP状态是down的C.该接口上配置发送IGMP查询消息的时间间隔60sD.该接口上IGMP查询报文中包含的最大响应时间0s

考题 检验内存性能的指标包括()。 A.存取时间B.CAS延迟时间C.奇偶校验D.ECC

考题 目前,流媒体技术主要应用于()方面。①远程教育;②宽带视频点播;③互联网直播;④实时视频会议 A.①②B.①②③C.②③④D.①②③④

考题 如果系统PN增量为3,那么总共可用的PN数为() A.160B.170C.200D.220