Problem in File Creation
I am a java beginner... I am doing a small standalone application.. In which i am using files..
In my code i want to get customer details and to store it in a file..i am using following code for doing that...
But while using this code..for each execution one file is created and details getting added and in next execution the old file is deleted along with the details....but i need one file is to be created and only details to be added in each execution...help me pls.... :confused:
File customer = new File("customer details.txt");
FileOutputStream fop1 = new FileOutputStream(customer);
See the API docs for FileOutputStream, namely its varying constructors. There is a way to "open" the file in append mode.