How can I save Data to a File? I tried to write some Data into a File by passing Strings from console,by combining InputStreamReader with BufferedReader then passing BufferedReader to the constructor of PrintWriter.But the problem the data which I stored in one execution lost completely in another execution.How can I save Data in file?
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
bhanushali bhavesh
Greenhorn
Joined: Sep 21, 2005
Posts: 3
posted
0
That implies that u are overwriting the file each time u execute the code , This can happen when u do a new BufferedWriter () thing .
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32654
4
posted
0
. . . overwriting the file . . .
You can avoid overwriting the file by altering the BufferedWriter and FileWriter constructors. It is very easy. See the API.
And please don't write posts in text language, but use full words. There are people from non-English speaking backgrounds who wouldn't understand words like "u."
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.