IO编程练习

Posted 丿随缘

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了IO编程练习相关的知识,希望对你有一定的参考价值。

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编程练习的主要内容,如果未能解决你的问题,请参考以下文章