码迷,mamicode.com
首页 > 其他好文 > 详细

IO编程练习

时间:2017-07-18 10:03:11      阅读:95      评论:0      收藏:0      [点我收藏+]

标签:length   put   new   str   blog   row   imp   string   div   

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
public class FileInputStream {
	public static void main(String[] args) throws IOException{
		// TODO Auto-generated method stub
        //文件名
		String str ="快乐十分钟";
		//创建对象
			FileOutputStream f = new FileOutputStream("hhhh");
		
		//写文件
		byte[] f1 = str.getBytes();
		int len = f1.length;
		for(int i=0;i<f1.length;i++){
			f.write(f1);
		}
		//关闭
		f.close();
		//读文件
		//创建对象
	}
      

IO编程练习

标签:length   put   new   str   blog   row   imp   string   div   

原文地址:http://www.cnblogs.com/adada/p/7198633.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!