1、在Java的IO操作中,()方法可以用来刷新流的缓冲。
A. void release()
B. void remove()
C. void close()
D. void flush()
查看答案
1、以下选项中关于如下代码的说法正确的是()。(选择二项)public class TestBuffered {public static void main(String[] args) throws IOException {BufferedReader br =new BufferedReader(new FileReader("d:/bjsxt1.txt"));BufferedWriter bw =new BufferedWriter(new FileWriter("d:/bjsxt2.txt"));String str = br.readLine();while(str !=null){bw.write(str);bw.newLine();str = br.readLine();}br.close();bw.close();}}
A. 该类使用字符流实现了文件复制,将d:/bjsxt1.txt复制为d:/bjsxt2.txt
B. FileReader和FileWriter是处理流,直接从文件读写数据
C. BufferedReader和BufferedWriter是节点流,提供缓冲区功能,提高读写效率
D. readLine()可以读取一行数据,返回值是字符串类型,简化了操作
1、BufferedReader和BufferedWriter是具有缓冲功能的流,使用它们可以提高读写效率。
A. 对
B. 错
2、BufferedReader类的readLine()方法,如果读到流的末尾,该方法返回的结果为null。
A. 对
B. 错
Listen to the recording again and fill in each of the blanks according to what you have heard.1)The freshman year at college is, generally speaking, a time filled with _____________, some anxiety, and _________________________________.