I am trying to make a game with a working highscore mechanism and I am using java.io.BufferedWriter to write to a highscore file. I don\'t have an encryption on the highscor
Please use writer.write(String.valueOf(score));
otherwise it writes score as a character.
See the documentation:
Writes a single character. The character to be written is contained in the 16 low-order bits of the given integer value; the 16 high-order bits are ignored.
What you want to use is Writer.write(String); convert score
to a String
using String.valueOf
or Integer.toString
.
writer.write(String.valueOf(score));