首页 > 其他 > 详细

实训---IO流

时间:2019-06-15 21:45:59      阅读:76      评论:0      收藏:0      [点我收藏+]
package Suchas;
 import java.io.*;
public class FileIO
{
    public FileIO(String str)
     {
         File f = new File("data.txt");
         try
         {
             File file = new File("data.txt");
             FileWriter fw = new FileWriter(file);
             BufferedWriter bw = new BufferedWriter(fw);
            bw.write(str);
             bw.close();
         } catch (IOException e)
         {
            e.printStackTrace();
        }
    }
    public static void main(String[] args)
    {
         String str = "12345abcdef@#%&*软件工程";
         new File(str);
 
     }
 
 }

实训---IO流

原文:https://www.cnblogs.com/al1018/p/11028858.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!