<<
ArrayList list = ...;
BufferedWriter writer = new BufferedWriter(new FileWriter(xxx));
writer.write(list);
writer.close();
>>
至少完成了写的需求。:)

解决方案 »

  1.   

    ArrayList al...
    PrintWriter pw=new PrintWriter(new FileWrite(xxxx));
    for (int i=0;i<al.size();i++)
      pw.println(al.get(i));
    pw.flush();
    pw.close();我想你的要求是这样的吧!
      

  2.   

    public class temp
    {
      public static void main(String[] args)
      {
        temp r = new temp();
        r.writeArray("c:/1.txt");
      }
    public static void writeArray(String path)
      {
       ArrayList list = new ArrayList();
       list.add("Hello");
       list.add("Hello");
       list.add("Hello");
      
      
       try
       {
       File nf = new File(path);
        if(!nf.exists())
        {
         nf.createNewFile();
        }    FileWriter fw = new FileWriter(path,true);
        String nextLine = System.getProperty("line.separator");
        for(int i = 0;i<list.size();i++)
        {
         fw.write((String)list.get(i)+nextLine);
        }
        fw.close();
    }catch(Exception e)
    {}
      }
    }