Which code fragment prints the contents of the customers.txt file?

Assume customers.txt is accessible and contains multiple lines.
Which code fragment prints the contents of the customers.txt file?
A. Stream<String> stream = Files.find (Paths.get ("customers.txt")); stream.forEach((String c) -> System.out.println(c));
B. Stream<Path> stream = Files.find (Paths.get ("customers.txt")); stream.forEach( c) -> System.out.println(c));
C. Stream<Path> stream = Files.list (Paths.get ("customers.txt")); stream.forEach( c) -> System.out.println(c));
D. Stream<String> lines = Files.lines (Paths.get ("customers.txt")); lines.forEach( c) -> System.out.println(c));

Download Printable PDF. VALID exam to help you PASS.

One thought on “Which code fragment prints the contents of the customers.txt file?

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.