Hello,
I want to fiqure why this simple code dose not work. I want to append data to an existing file but it has to be a number not a String.
File f = new File("C:\\Test\\kkk.txt"); FileWriter wf = new FileWriter(f,true); BufferedWriter br = new BufferedWriter(wf); int x = 50; br.write(x); br.close(); } }
I am still trying to learn so if it's a simple mistake I'm sorry. The following code writes a random number to a text file. I am making an educated guess that it's reading it as binary and in some shape form or fashion 50 equals 2 or something in binary. How do I get to just to write 50 at the end of the file. I know I can use the formatter class but that doesn't have a method for appending my data.