Which code fragment correctly appends “Java 7” to the end of the file /tmp/msg.txt?
A.
FileWriter w = new FileWriter(“/tmp/msg.txt”, true); append(“Java 7”); close();
B.
FileWriter w = new FileWriter(“/tmp/msg.txt”, FileWriter.MODE_APPEND); append(“Java
7″); close();
C.
FileWriter w = new FileWriter(“/tmp/msg.txt”, Writer.MODE_APPEND); append(“Java 7”);
close();
D.
FileWriter w = new FileWriter(“/tmp/msg.txt”); append(“Java 7”); close();
“append” should be read “w.append” in every answer
and close -> w.close