It is necessary to write the lines from the array into a text file, each with a new line. I have already added line breaks everywhere \ n - but for some reason everything is written in one line.
String[] list = { "Строка 1 \n", "Строка 2\n", "Строка 3\n"}; BufferedWriter writer = new BufferedWriter(new PrintWriter("C:\\javaproject\\someFIle.txt")); for (String s : list) { writer.write(s + "\n"); } writer.close();