ExamQuestions.com

Register
Login
Java SE 8 Programmer II Exam Questions

Oracle

Java SE 8 Programmer II

20 / 130

Question 20:

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? 

Answer options:

A. An exception is thrown at run time.
B. 2:MyPic.jpeg: MyPic.jpeg
C. 3:.:MyPic.jpeg
D. 2:Pics: MyPic.jpeg