Oracle
1Z0-809 · Question #117
1Z0-809 Question #117: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #117. The question stem and answer options stay visible for context.
Question
Given the code fragment:
Path file = Paths.get ("courses.txt");
// line n1
Assume the courses.txt is accessible.
Which code fragment can be inserted at line n1 to enable the code to print the content of the courses.txt file?
Options
- AList<String> s = Files.list(file); fc.stream().forEach (s -> System.out.println(s));
- BStream<String> fc = Files.readAllLines (file); fc.forEach (s -> System.out.println(s));
- CList<String> fc = Files.readAllLines (file); fc.stream().forEach (s -> System.out.println(s));
- DStream<String> fc = Files.list (file); fc.forEach (s -> System.out.println(s));
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.