Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Oracle Exam 1Z0-809 Topic 16 Question 46 Discussion

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

Given the code fragment:

Path p1 = Paths.get(''/Pics/MyPic.jpeg'');

System.out.println (p1.getNameCount() +

'':'' + p1.getName(1) +

'':'' + p1.getFileName());

Assume that the Pics directory does NOT exist.

What is the result?

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

Lilli
7 days ago
Hmm, I'm not too sure about this one. If the directory doesn't exist, I'm guessing it might try to create it or something. Let's see, maybe B is the answer? 2:MyPic.jpeg: MyPic.jpeg sounds about right.
upvoted 0 times
...
Bok
13 days ago
I agree with Dorothea, the correct answer is D) 2:Pics: MyPic.jpeg due to the directory not existing.
upvoted 0 times
...
Dorothea
14 days ago
I believe the answer is D) 2:Pics: MyPic.jpeg because the directory Pics does not exist.
upvoted 0 times
...
Lawrence
15 days ago
I think the answer is A) An exception is thrown at run time.
upvoted 0 times
...
Rory
16 days ago
I agree with Yun, the correct answer is D) 2:Pics: MyPic.jpeg due to the directory not existing.
upvoted 0 times
...
Yun
18 days ago
I believe the answer is D) 2:Pics: MyPic.jpeg because the directory Pics does not exist.
upvoted 0 times
...
King
20 days ago
I think the answer is A) An exception is thrown at run time.
upvoted 0 times
...
Dustin
22 days ago
Well, this is a tricky one. I'm going to go with A - an exception is thrown at run time. The Paths.get() method requires the directory to exist, so if it doesn't, it's going to throw an exception. Let's see how it plays out!
upvoted 0 times
Alethea
6 days ago
I think it's B) 2:MyPic.jpeg: MyPic.jpeg
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