这会将行的数组列表导出到文件
//n o w j a v a . c o m 提 供 //package com.nowjava; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; public class Main { /** * This exports the array list of lines to a file * @param lines the lines of the text file * @param dataFile the file to put the lines into */ public static void exportLinesToFile(ArrayList<String> lines, Path dataFile) { try { Files.write(dataFile, lines, StandardCharsets.UTF_8); } catch (IOException ex) {