Hello.
I have a question about working and writing to files. I tried to write to a file using a BufferedWriter, and then use the same BufferedWriter to write to a new file. I've created a new FileWriter object, in which constructor i've passed a new file reference, but that not worked as i was expecting.
Here is the code :
After i'm running this code, there is no text been writed in f2. It's been writed twice in f1.
If i insert this
bw = new BufferedWriter(fw);
on the "//insert code" line, the code will run as i want, but i don't understant why it's not enough to make only fw refering to a new object ?
Is this a
String related behavior?