package bbb; import java.io.*; public class ccc { public static void main(String args[]) throws IOException{ String str[] = {"12345abcdef@#%&*软件工程"}; File file= new File("data.text"); Writer f=new FileWriter(file); BufferedWriter b = new BufferedWriter(f); int buffer = str.length; for(int i=0;i<str.length;i++){ b.write(str[i]); b.newLine(); } b.close(); f.close(); System.out.println("绝对路径:"+file.getAbsolutePath()); } }