Write int to text file using Writer

You have to write String…

you can try.

wr.write("123");

OR

wr.write(new Integer(123).toString());

OR

wr.write( String.valueOf(123) );

Leave a Comment