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?
List fc = Files.list(file);fc.stream().forEach (s -> System.out.println(s));
Stream fc = Files.readAllLines (file);fc.forEach (s - > System.out.println(s));
List fc = Files.readAllLines(file);fc.stream().forEach (s -> System.out.println(s));
Stream fc = Files.list (file);fc.forEach (s -> System.out.println(s));
Submit