代码改变世界

IO

2019-06-12 15:15  飘转至原点  阅读(216)  评论(0编辑  收藏  举报

package bbb;
import java.io.*;
public class eeeeeeeeeee {
    
        
public static void main(String[] args) throws IOException{
        
        File f1 = new File("D://asd.txt");
        FileReader fw = new FileReader(f1);
        BufferedReader bw =new BufferedReader(fw);
        String str;
        while((str=bw.readLine())!=null){
            System.out.println(str);
        }
        bw.close();
        fw.close();
        
}
}

 

package bbb;
import java.io.*;
public class strrrrr {
    
    public static void main(String[] args) throws IOException{
        String str = "12345abcde@#%&*";
        File f1 = new File("D://data.txt");
        FileWriter fw = new FileWriter(f1);
        BufferedWriter bw =new BufferedWriter(fw);
        bw.write("LRNP");
        bw.newLine();
        bw.write(str);
        bw.newLine();
        bw.close();
        fw.close();
    }

}