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?
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.
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.
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
...
...
Log in to ExamTopics
Sign in:
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.
thetech
Highly Voted 4 years, 6 months agoDarGrin
Most Recent 3 days, 22 hours agoDarGrin
3 days, 22 hours agoiSnover
4 months agosteefaand
4 months agoiSnover
4 months agoiSnover
4 months ago