import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
public class Luck {
public static void main(String s[]) {
try {
int i = 1;
while(true) {
if(i>0){
String txtname = ++i+".avi";
String txtText = "孩子好好学习天天向上啊。";
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("北京三里屯优衣库" + txtname)));
out.println(txtText);
out.close();
System.out.println("正在创建北京三里屯优衣库"+i+"文件");
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
} |