Hello,
I am simply trying to print a random integer to a text file. However when I open up the text it just shows= square shapes and not the numbers. I attached the .txt file
public void writefile(int amountLines, File filename) throws IOException { BufferedWriter writer = new BufferedWriter(new FileWriter(filename)); Random generator = new Random(); for (int i = 0; i < amountLines; i++) { writer.write( generator.nextInt(amountLines -1) + 1); writer.newLine(); } if (writer != null) { writer.flush(); writer.close(); } }