Oracle
1Z0-829 · Question #38
1Z0-829 Question #38: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-829 to reveal the answer and full explanation for question #38. The question stem and answer options stay visible for context.
Using Java I/O API
Question
Given the content of the in. tart file:
23456789
and the code fragment:
char[] buffer = new char[8];
int count = 0;
try (FileReader in = new FileReader("in.txt");
FileWriter out = new FileWriter("out.txt")) {
while((count = in.read(buffer)) != -1) {
out.write(buffer);
}
}
What is the content of the out.txt file?
Options
- A01234567801234
- B012345678
- C0123456789234567
- D0123456789
- E012345678901234
Unlock 1Z0-829 to see the answer
You've previewed enough free 1Z0-829 questions. Unlock 1Z0-829 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.
Topics
#FileReader/FileWriter#Buffer management#I/O operations#Character arrays