【JAVA 17.2】+ IO

来源:互联网 发布:新网互联域名管理平台 编辑:程序博客网 时间:2024/06/05 16:18

练练手~

实现代码:

package SevenTeen;import java.io.FileOutputStream;public class Two {    public static void main(String[] args) throws Exception{        try{        FileOutputStream f = new FileOutputStream("f.dat");        int a = 0;        while(a < 100){            f.write((int) Math.random() * 100);            a++;        }        }catch (Exception e){            e.printStackTrace();        }    }}
0 0
原创粉丝点击