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);
}
しかし、それは機能しません。append
またはPrintWriter
メソッドのヘルプを提供してください。これらのメソッドの使用方法がわかりません。
次のようなファイル出力が必要です
Result 1 : 45 //here 45 is ans
Result 2 : 564856
Result 3 : 879
.
.
.
.
Result 10 : 564
ありがとう