Solved

Which of the Following Statements Opens a File Named MyFile

Question 41

Multiple Choice

Which of the following statements opens a file named MyFile.txt and allows you to append data to its existing contents?


A) FileWriter fwriter = new FileWriter("MyFile.txt") ;
PrintWriter outFile = new PrintWriter(fwriter) ;
B) FileWriter fwriter = new FileWriter("MyFile.txt", true) ;
PrintWriter outFile = new PrintWriter(fwriter) ;
C) PrintWriter outfile = new PrintWriter("MyFile.txt", true) ;
D) PrintWriter outfile = new PrintWriter(true, "MyFile.txt") ;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions