meow00
asked on
output files in java.
Hello experts,
I tried to output a String to a file in the following way.
--------------------------
String myData = " a lot of data here";
FileWriter outFile = new FileWriter(new File("result.txt"));
outFile.write(myData);
--------------------------
but my "result.txt" is empty. Does anyone know what I did wrong ? Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
And as a good practice, close () in finally blocks.