回覆列表
  • 1 # 使用者8530885686659

    List<String> outList = new ArrayList<String>();

    OutputStream fOut = null;

    try {

    fOut = new FileOutputStream(new File("D:/test.txt"));

    }

    catch (FileNotFoundException e) {

    // TODO Auto-generated catch block

    e.printStackTrace();

    }

    for(String Str:outList){

    try {

    fOut.write((Str+"\n").getBytes());

    }

    catch (IOException e) {

    // TODO Auto-generated catch block

    e.printStackTrace();

    }

    }

    if(fOut != null){

    try {

    fOut.close();

    }

    catch (IOException e) {

    // TODO Auto-generated catch block

    e.printStackTrace();

    }

    }

  • 中秋節和大豐收的關聯?
  • 怎麼更換淨水器的濾芯?