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