登录
首页
笔记
分类
Toggle navigation
更多 >
-
hot
JAVA题库
new
BASIC题库
您所在的当前位置:
计算机等级考试题库
>
JAVA题库
>
[问答题] 请完成下列Java程序。程序的功能是复制文件并显示文件,将每个字符读入,并写入另一个文件,同时显示出来。(注意:在本题中,是将D盘的JDK目录下的README.txt文件打印在屏幕上,并写入另一个文件temp.txt中) 注童:请勿改动main()主方法和其他已有的语句内容,仅在下划线处填入适当的语句。 import java.io.*; public class FileCopyBy public static void main(String args[]) try FileReader input=new FileReader("FileCopyBy.java"); FileWriter output=new FileWriter("temp.txt"); int c=input.read(); while(__________) _______________ System.out.print((charc); c=input.read(); input.close(); output,close(); catch(IOException e) System.out.println(e);
问题:
发布时间:2022-07-01
[问答题] 请完成下列Java程序。程序的功能是复制文件并显示文件,将每个字符读入,并写入另一个文件,同时显示出来。(注意:在本题中,是将D盘的JDK目录下的README.txt文件打印在屏幕上,并写入另一个文件temp.txt中)
注童:请勿改动main()主方法和其他已有的语句内容,仅在下划线处填入适当的语句。
import java.io.*;
public class FileCopyBy
public static void main(String args[])
try
FileReader input=new FileReader("FileCopyBy.java");
FileWriter output=new FileWriter("temp.txt");
int c=input.read();
while(__________)
_______________
System.out.print((charc);
c=input.read();
input.close();
output,close();
catch(IOException e)
System.out.println(e);
参考答案:
题目声明
提问用户:OJ***Ase
答案有错?我要纠错
查看答案(免费不限制)
提交纠错答案
可能感兴趣的题目:
1