What is the result?

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?
A. An exception is thrown at run time.
B. 2:MyPic.jpeg: MyPic.jpeg
C. 1:Pics:/Pics/ MyPic.jpeg
D. 2:Pics: MyPic.jpeg

Download Printable PDF. VALID exam to help you PASS.

2 thoughts on “What is the result?

Leave a Reply

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


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