为什么用缓冲流读取时文本变空了?

import java.io.*;

public class Test3 {


public static void main(String[] args) {

       

       try{

      FileReader fr=new FileReader("E:/java demo/Hello1.txt");

      BufferedReader br=new BufferedReader(fr);

      FileWriter fw=new FileWriter("E:/java demo/Hello1.txt");

      BufferedWriter bw=new BufferedWriter(fw);

      String s;

      

      s=br.readLine();

      System.out.println(s);

     

      fr.close();

      br.close();

      fw.close();

      bw.close();

       }

       catch(IOException ioe){System.out.println(ioe);}

}


}


慕码人7768818
浏览 1409回答 3
3回答

伍六

FileReader fr=new FileReader("E:/java demo/Hello1.txt");FileWriter fw=new FileWriter("E:/java demo/Hello1.txt");

car

  FileReader fr=new FileReader("E:/java demo/Hello1.txt");FileWriter fw=new FileWriter("E:/java demo/Hello1.txt");
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java