Which code fragment correctly appends “Java 7” to the end of the file /tmp/msg.txt?

Which code fragment correctly appends "Java 7" to the end of the file /tmp/msg.txt?
A. FileWriter w = new FileWriter("/tmp/msg.txt"); append("Java 7"); close();
B. FileWriter w = new FileWriter("/tmp/msg.txt", true); append("Java 7"); close();
C. FileWriter w = new FileWriter("/tmp/msg.txt", FileWriter.MODE_APPEND); append("Java 7"); close();
D. FileWriter w = new FileWriter("/tmp/msg.txt", Writer.MODE_APPEND); append("Java 7"); close();

Download Printable PDF. VALID exam to help you PASS.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.