ExamQuestions.com

Register
Login
Java SE 8 Programmer II Exam Questions

Oracle

Java SE 8 Programmer II

31 / 130

Question 31:

Given the code fragment: Stream<Path> files = Files.walk(Paths.get(System.getProperty("user.home"))); files.forEach (fName -> {//line n1 try { Path aPath = fName.toAbsolutePath(); //line n2 System.out.println(fName + ":" + Files.readAttributes(aPath, Basic.File.Attributes.class).creationTime ()); } catch (IOException ex) { ex.printStackTrace(); }); What is the result? 

Answer options:

A. All files and directories under the home directory are listed along with their attributes.
B. A compilation error occurs at line n1.
C. The files in the home directory are listed along with their attributes.
D. A compilation error occurs at line n2.