给你改了一下,可以了==================================================import java.io.*; public class app21 { public static void main(String args[]) throws IOException { FileWriter fw=new FileWriter(\"c:\\\\go.txt\"); char data[]={\'h\',\'e\',\'l\',\'l\',\'o\',\'j\',\'a\',\'v\',\'a\',\'\\r\',\'\\n\'};String str=(\"end of file\"); fw.write(data); fw.write(str); fw.close(); } } |