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