exam questions

Exam 1z0-809 All Questions

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

Exam 1z0-809 topic 1 question 25 discussion

Actual exam question from Oracle's 1z0-809
Question #: 35
Topic #: 2
[All 1z0-809 Questions]

Given the code fragment:
LocalDate valentinesDay =LocalDate.of(2015, Month.FEBRUARY, 14);
LocalDate nextYear = valentinesDay.plusYears(1);
nextYear.plusDays(15); //line n1
System.out.println(nextYear);
What is the result?

  • A. 2016-02-14 DateTimeException is thrown.
  • B. A
  • C. 2016-02-29 line n1.
  • D. A compilation error occurs at
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

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
thetech
Highly Voted 4 years, 6 months ago
After running the program the result will be 2016-02-14
upvoted 7 times
...
DarGrin
Most Recent 3 days, 22 hours ago
Selected Answer: C
2016-02-14
upvoted 1 times
DarGrin
3 days, 22 hours ago
answer is A
upvoted 1 times
...
...
iSnover
4 months ago
Selected Answer: A
I apologize for the wrong answer, there was a typo in the letter A which after the result would throw an Exception but the Exception part does not exist. What makes answer A correct. My other comment is wrong.
upvoted 1 times
...
steefaand
4 months ago
Selected Answer: A
A is true without exception part.
upvoted 2 times
...
iSnover
4 months ago
Selected Answer: C
The answer is C, there is a similar question where the answer would be "2016-02-14" but there is no such answer, so the answer is "2016-02-29 line n1." which is true, the "nextYear" variable gains this value in line n1 but after it loses it because DateTime are immutable and another variable did not store the value.
upvoted 1 times
iSnover
4 months ago
I apologize for the wrong answer, there was a typo in the letter A which after the result would throw an Exception but the Exception part does not exist. What makes answer A correct. My other comment is wrong.
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