将字符串值写入文件
import java.io.BufferedWriter;/* 来自 n o w j a v a . c o m - 时代Java*/ import java.io.FileWriter; import java.io.IOException; public class Main { public static void main(String[] args) { try { BufferedWriter out = new BufferedWriter(new FileWriter("outfilename")); out.write("aString"); out.close(); } catch (IOException e) { } } }