Oracle
1Z0-805 · Question #5
1Z0-805 Question #5: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-805 to reveal the answer and full explanation for question #5. The question stem and answer options stay visible for context.
Question
Given the code fragment: public static void processFile () throws IOException { Try (FileReader fr = new FileReader ("logfilesrc.txt"); FileWriter fw = new FileWriter ("logfilesdst.txt") ) { int i = fr.read(); } } Which statement is true?
Options
- AThe code fragment contains compilation errors.
- BThe java runtime automatically closes the FileWriter Instance first and the FileReader instance next.
- CThe java runtime automatically closes the FileReader Instance first and the FileWriter instance next.
- DThe developer needs to close the FileReader instance first and the FileWriter instance explicitly in a
- EThe Java runtime may close the FileReader and FileWriter instance in an intermediate manner.
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.