Question: please help me revise the code, Given an initialized String variable fileName, write a sequence of statements that append the line All is well. to
please help me revise the code, 
Given an initialized String variable fileName, write a sequence of statements that append the line "All is well." to the file whose name is given by the variable. Make sure that the data written to the file has been flushed from its buffer and that any system resources used during the course of running these statements have been released. (Do not concern yourself with any possible exceptions here-- assume they are handled elsewhere.) 1/*FileWriter fw = new FileWriter("greeting");//created file 2 BufferedWriter bw = new BufferedWriter(fw);//assign writer 3 bw.write("Hello, World!");//write line 4 bw.close();//close the file */5 Printwriter fileName = new Printwriter("All is well."); 6 fileName.flush(); 7 fileName.close()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
