for(i=0;i<10;i++){
String output = output + "Result "+ i +" : "+ ans +"\n"; //ans from other logic
FileWriter f0 = new FileWriter("output.txt");
f0.write(output);
}
but it doesn't work,
please give some help for append
or PrintWriter
method, i have no idea how to use these methods.
i need file output like
Result 1 : 45 //here 45 is ans
Result 2 : 564856
Result 3 : 879
.
.
.
.
Result 10 : 564
thanks