阅读下列代码
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()
}
}
请说出下划线上,填写的方法名称
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()
}
}
请说出下划线上,填写的方法名称
举一反三
- 阅读下段代码 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 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()
- 中国大学MOOC: 下列代码中构造方法的返回类型是()public class Village { Village () { System .out .println(“hiding in Village”) ; } public static void main( String args [ ]) { Village c =new Village ( ) ;}class Village { public static void main( String args [ ]) { Village c =new Village ( ) ; } Village () { System .out .println(“hiding in Village”) ; } }
- 阅读下列代码 import java.io.*; public class Example{ public static void main(String[] args) throws Exception { // 创建一个带缓冲区的输入流 BufferedInputStream bis = new BufferedInputStream(new ________( "src.txt")); // 创建一个带缓冲区的输出流 BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("des.txt")); int len; while ((len = bis.read()) != -1) { bos.write(len); } bis.close(); bos.close(); } } 请说出程序中,下划线位置的答案( )