Oracle
1Z0-805 · Question #85
1Z0-805 Question #85: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-805 to reveal the answer and full explanation for question #85. The question stem and answer options stay visible for context.
Question
Given the code fragment: static void addContent () throws Exception { Path path = Paths.get("D:\company\report.txt"); UserPrincipal owner = path.getFileSystem().getUserPrincipalLookupService().lookupPrincipalByName("Bob"); Files.setOwner(path, owner); // insert code here ?Line ** br.write("this is a text message "); } System.out.println("success"); } Assume that the report.txt file exists. Which try statement, when inserted at line **, enables appending the file content without writing the metadata to the underlying disk?
Options
- Atry (BufferWriter br = Files.newBufferedWriter (path, Charset.forName ("UTF-8"), new openOption []
- Btry (BufferWriter br = Files.newBufferedWriter (path, Charset.forName ("UTF-8"), new openOption []
- Ctry (BufferWriter br = Files.newBufferedWriter (path, Charset.forName ("UTF - 8"), new openOption []
- Dtry (BufferWriter br = Files.newBufferedWriter (path, Charset.forName ("UTF?;), new openOption []
- Etry (BufferWriter br = Files.newBufferedWriter (path, Charset.forName ("UTF - 8"), new openOption []
Unlock 1Z0-805 to see the answer
You've previewed enough free 1Z0-805 questions. Unlock 1Z0-805 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.