Question 91 of 130 from exam 1Z0-809: Java SE 8 Programmer II

Question 91 of 130 from exam 1Z0-809: Java SE 8 Programmer II

Question

Given the content of the employee.txt file: Every worker is a master.

Given that the employee.txt file is accessible and the file allemp.txt does NOT exist, and the code fragment:

try {
List<String> content = Files.readAllLines (Paths.get ("employee.txt")) 7
content.stream().forEach(line -> {
try {
Files.write(
Paths.get ("allemp.txt"),
line.getBytes(),
Standardopenoption.APPEND
ve
} catch (IOException e) { System.out.println("Exception 1"); }
de
} catch (IOException e) { System.out.printin("Exception 2"); }

What is the result?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

A.