exam questions

Exam 1z0-819 All Questions

View all questions & answers for the 1z0-819 exam

Exam 1z0-819 topic 1 question 122 discussion

Actual exam question from Oracle's 1z0-819
Question #: 122
Topic #: 1
[All 1z0-819 Questions]

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

  • A. Paths.get("foo")
  • B. Paths.getPath("too")
  • C. Path.get(new URI("file:///domains/oracle/test.txt"))
  • D. new Path("foo")
  • E. Paths.get(URL.create("file:///domains/oracle/test.txt"))
Show Suggested Answer Hide Answer
Suggested Answer: AE 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
ASPushkin
1 month, 3 weeks ago
Selected Answer: AE
E correct if URL changes to URI (URL doesn't have create method) A correct B failed Paths doesn't have method getPath() C failed Path doesn't have get(). It has of(). D failed Path - interface
upvoted 1 times
...
d7bb0b2
6 months ago
A = ok E = ok (paths.get accepts string and URI as argument)
upvoted 1 times
...
Omnisumem
9 months, 1 week ago
Selected Answer: AE
tested: AE. We suppose it is URI.create instead of URL.create...
upvoted 1 times
...
dilleman
9 months, 2 weeks ago
Selected Answer: AE
A and E
upvoted 1 times
...
Stavok
11 months, 2 weeks ago
Selected Answer: AE
You can easily create a Path object by using one of the following get methods from the Paths (note the plural) helper class: Path p1 = Paths.get("/tmp/foo"); Path p2 = Paths.get(args[0]); Path p3 = Paths.get(URI.create("file:///Users/joe/FileTest.java"));
upvoted 1 times
...
Stavok
11 months, 3 weeks ago
A and E are correct
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago