file write in java new line code example Example: java filewriter new line fileWriter.write(System.lineSeparator());