寫入檔案

import java.io.FileWriter;

import java.io.IOException;

public class test {

public static void main(String [] argv) throws IOException {

FileWriter fw = new FileWriter("test.txt");

fw.write("test");

fw.flush();

fw.close();

}

}