日期:2014-05-17 浏览次数:20713 次
package test;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class FileOperation
{
public static void main(String[] args) throws IOException
{
String str1="第一个字符串";
String str2="字符串二";
String str3=str1+" "+str2;
File file=new File("D:/example/Directory/c.txt");
FileWriter fw=new FileWriter(file);
BufferedWriter bw=new BufferedWriter(fw);
bw.write(str3);
bw.close();
fw.close();
}
}