Java SE 11 Developer (1Z0-819) — Question 143

Which two expressions create a valid Java Path instance? (Choose two.)

Answer options

Correct answer: A, E

Explanation

Option A is correct because Paths.get() is a valid method to create a Path instance. Option E is also correct since Paths.get() can handle a URL. Options B, C, and D are incorrect because Paths.getPath() does not exist, Path.get() does not take a URI directly, and new Path() is not a valid constructor in the Java NIO package.