String path = ""; String str = "";
FileWriter writer; try { path = ""; path = "c:/test/test.txt";//目录 writer = new FileWriter(path); writer.write("123"); //到达指定目录
writer.close();
} catch (IOException e2) { e2.printStackTrace(); }