76 383
Assignments Done
Successfully Done
In May 2019

Answer to Question #20638 in Java | JSP | JSF for nohra

Question #20638
When we open a file for appending and the file already exists
A) There is a compiler error
B) There is a runtime error
C) The file contents will be overwritten
D) We will be adding data at the end of the file
Expert's answer
this code appends "row" to a file. parameter "true" in "FileWriter(fileName, append)" constructor provides appending to existing file. if file does not exists, it creates this file.

public void writeIn(File file) throws IOException, ClassNotFoundException
String row="row";

PrintWriter out1 = new PrintWriter(new BufferedWriter(new FileWriter(file,true)));

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions