Opening an existing file in Java and closing it.
问题 Is it possible to open a file a in java append data and close numerous times. For example: //---- psuedocode //class variable declaration FileWriter writer1 = new FileWriter(filename); fn1: writer.append(data - title); fn2: while(incomingdata == true){ writer.append(data) writer.flush(); writer.close() } The problem lies in the while loop. The file is closed and cant be opened again. Any one can help me in this? 回答1: The answers that advise against closing and re-opening the file each time