Oracle Java SE 8 Programmer II 1z0-809 Question # 48 Topic 5 Discussion

Oracle Java SE 8 Programmer II 1z0-809 Question # 48 Topic 5 Discussion

1z0-809 Exam Topic 5 Question 48 Discussion:
Question #: 48
Topic #: 5

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?


A.

List fc = Files.list(file);fc.stream().forEach (s -> System.out.println(s));


B.

Stream fc = Files.readAllLines (file);fc.forEach (s - > System.out.println(s));


C.

List fc = Files.readAllLines(file);fc.stream().forEach (s -> System.out.println(s));


D.

Stream fc = Files.list (file);fc.forEach (s -> System.out.println(s));


Get Premium 1z0-809 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.