阅读下段代码import java.io.*;public class Example{public static void main(String[] args) throws Exception {FileInputStream fis = new FileInputStream("file.txt");FileOutputStream fos = new FileOutputStream("copy_file.txt");int ch = 0;while((ch =fis.read())!=-1){fos.write(ch);}fos._______;fis.close();}}请说出下划线上,填写的方法名称( )
A: write()
B: close()
C: available()
D: read()
A: write()
B: close()
C: available()
D: read()
举一反三
- 阅读下段代码 import java.io.*; public class Example{ public static void main(String[] args) throws Exception { FileInputStream fis = new FileInputStream("file.txt"); FileOutputStream fos = new FileOutputStream("copy_file.txt"); int ch = 0; while((ch =fis.read())!=-1){ fos.write(ch); } fos._______; fis.close(); } } 请说出下划线上,填写的方法名称
- 【单选题】阅读下段代码 import java.io.*; public class Example{ public static void main(String[] args) throws Exception { FileInputStream fis = new FileInputStream("file.txt"); FileOutputStream fos = n
- 阅读下列代码 import java.io.*; public class Example { public static void main(String[] args) throws Exception { FileInputStream in = new FileInputStream("itcast.txt"); int b = 0; while (true) { b = in.______; if (b == -1) { break; } System.out.println(b); } in.close() } } 请说出下划线上,填写的方法名称
- 下列写法错误的是 A: File f = new File ("a.txt"); B: File f = new File ("d:\\a.txt"); C: FileInputStream fis = new FileInputStream (new File ("a.txt")); D: FileOutputStream fos = new FileOutputStream ( File ("."));
- 阅读下段代码importjava.io.*;publicclassExample{publicstaticvoidmain(String[]args)throwsException{FileInputStreamfis=newFileInputStream("file.txt");FileOutputStreamfos=newFileOutputStream("copy_file.txt");intch=0;while((ch=fis.read())!=-1){fos.write(ch);}fos._______;fis.close();}}请说出下划线上,填写的方法名称