日期:2014-05-20 浏览次数:20937 次
import java.io.File;
import java.io.PrintWriter;
public class testMe {
public static void main(String args[])throws Exception{
String[] filename = new String[101];
for (int n = 0;n<11;n++)
{
filename[n]="a" + n + ".txt";
java.io.File testvec = new File(filename[n]);
java.io.PrintWriter testout = new PrintWriter(testvec);
testout.print("The weather is good!");
testout.flush();
testout.close();
}
}
}
testout.flush();
FileOutputStream fo = new FileOutputStream("1.txt");
PrintWriter ps = new PrintWriter(fo);
ps.println("经过阿拉穆·哈尔发一战,轴心国军队损失惨重。德军与意军的士兵都变得很疲惫,并且他们只能靠缴获的盟军给养来维持生活。");
ps.close();
fo.close();