Oracle
1Z0-809 · Question #217
1Z0-809 Question #217: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #217. The question stem and answer options stay visible for context.
Question
Assume customers.txt is accessible and contains multiple lines.
Which code fragment prints the contents of the customers.txt file?
Options
- AStream<String> stream = Files.find (Paths.get ("customers.txt")); stream.forEach( (String c) -> System.out.println(c));
- BStream<Path> stream = Files.find (Paths.get ("customers.txt")); stream.forEach( (c) -> System.out.println(c));
- CStream<Path> stream = Files.list (Paths.get ("customers.txt")); stream.forEach( (c) -> System.out.println(c));
- DStream<String> stream = Files.lines (Paths.get ("customers.txt")); lines.forEach( (c) -> System.out.println(c));
Unlock 1Z0-809 to see the answer
You've previewed enough free 1Z0-809 questions. Unlock 1Z0-809 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.