Independence Day Deal! Unlock 25% OFF Today – Limited-Time Offer - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Oracle Exam 1Z0-809 Topic 3 Question 80 Discussion

Actual exam question for Oracle's 1Z0-809 exam
Question #: 80
Topic #: 3
[All 1Z0-809 Questions]

Given the code fragment:

Stream 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?

Show Suggested Answer Hide Answer
Suggested Answer: B, C

Contribute your Thoughts:

Eliz
1 months ago
I'm pretty sure the answer is C. After all, who doesn't love a good old-fashioned file listing? It's like a treasure hunt, but with less excitement and more dust bunnies.
upvoted 0 times
Eun
15 days ago
I think you're right, it should be C.
upvoted 0 times
...
...
Cecily
1 months ago
Wait, is this a trick question? If the code compiles, it should list all the files and directories in the home directory, so I think A is the correct answer. Unless, of course, there's some kind of hidden bug that makes the whole thing blow up in my face. *nervous laughter*
upvoted 0 times
Darrin
12 days ago
Let's hope there are no hidden bugs waiting to surprise us!
upvoted 0 times
...
Darrin
1 months ago
Yeah, I agree. It should list all the files and directories in the home directory if the code runs without any errors.
upvoted 0 times
...
Darrin
1 months ago
I think you're right, option A seems to be the most logical choice.
upvoted 0 times
...
...
Graciela
2 months ago
This is a tricky one! I'm going to go with D. The `toAbsolutePath()` method could throw an `IOException`, so there might be a compilation error at line n2.
upvoted 0 times
Jill
5 days ago
I'm not sure about this one, but I'll go with C as well. The files in the home directory are listed along with their attributes.
upvoted 0 times
...
Clorinda
8 days ago
I agree with you, I also think it's C. The files in the home directory are listed along with their attributes.
upvoted 0 times
...
Eliz
17 days ago
I think the answer is C. The files in the home directory are listed along with their attributes.
upvoted 0 times
...
...
Juan
2 months ago
Hmm, I'm not sure about this one. The use of the `forEach()` method makes me think there might be a compilation error at line n1, so I'll go with B.
upvoted 0 times
Truman
4 days ago
User1: Let's see if we're right about the compilation error at line n1.
upvoted 0 times
...
Cecil
6 days ago
User3: I'm not sure, but I'll also choose option B.
upvoted 0 times
...
Dawne
12 days ago
User2: Yeah, I agree. I'll go with option B.
upvoted 0 times
...
Gilma
14 days ago
User1: I think there might be a compilation error at line n1.
upvoted 0 times
...
...
Georgene
2 months ago
This code looks straightforward, so I think the correct answer is C. The files in the home directory should be listed along with their attributes.
upvoted 0 times
...
Pearline
2 months ago
I'm not sure, but I think option A could also be a possibility. It might list all files and directories under the home directory.
upvoted 0 times
...
Nidia
2 months ago
I agree with Scot, option C seems correct. The code is using Files.walk to list files in the home directory.
upvoted 0 times
...
Scot
2 months ago
I think the answer is C because the code is listing files in the home directory with their attributes.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77