好吧,我自己总结。老罗别忘了加3哦
File类中:
File f =new File("heima.txt");
f.createNewFile();
RandomAccessFile类:
RandomAccessFile f = new RandomAccessFile ("heima.txt","rw");
f.close();
FileOutputStream类:
FileOutputStream f = new FileOutputStream("heima.txt");
f.close();
FileWrite类:
FileWriter f =new FileWriter("heima.txt");
总结的就这么多了,都实验了,可以生成文件,要是有不全的地方,大家提出啊 |