exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 113 discussion

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

Given the code fragment:

What is the result?

  • A. An exception is thrown at runtime.
  • B. 07-31-2014
  • C. 2014-07-31
  • D. 2014-09-30
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

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
v323rs
Highly Voted 5 years ago
Agree, the correct answer C 2014-07-31; System.out.println(dt.format(DateTimeFormatter.ISO_DATE));
upvoted 12 times
...
Sudhakar_Senthilkumar
Most Recent 2 weeks, 3 days ago
Selected Answer: C
Tested. modified days and months doesn't dtored back to "dt". So, "dt" remains unchanged. Answer is C - (2014-07-31)
upvoted 1 times
...
MPignaProTech
2 months, 2 weeks ago
Selected Answer: C
C is correct
upvoted 1 times
...
5df1d00
3 months, 3 weeks ago
Selected Answer: C
Answer is C
upvoted 1 times
...
Sisar
4 months, 3 weeks ago
Selected Answer: C
Correct is C. Tested.
upvoted 1 times
...
x979
1 year, 1 month ago
Selected Answer: C
LocalDateTime is immutable. dt.plusdays(30) saves to no where
upvoted 1 times
...
x979
1 year, 1 month ago
LocalDateTime is immutable. dt.plusdays(30) saves to no where
upvoted 1 times
...
zhiradev
1 year, 2 months ago
Selected Answer: C
C is correct
upvoted 1 times
...
fvelazqueznava
1 year, 3 months ago
Selected Answer: A
ISO_DATE NEEDS TO BE ISO_DATE_TIME
upvoted 1 times
...
duydn
1 year, 4 months ago
Selected Answer: A
LocalDateTime cannot convert o LocalDate -> A (maybe the answer is Compilation error)
upvoted 2 times
...
Sreeni_A
1 year, 5 months ago
Answer is C
upvoted 1 times
...
akbiyik
2 years, 1 month ago
Selected Answer: C
Answer is C
upvoted 1 times
...
carloswork
2 years, 2 months ago
Selected Answer: C
Answer is C (Fixing punctuation and whitespace). To test: public static void main(String[] args) { LocalDateTime dt = LocalDateTime.of(2014, 7, 31, 1, 1); dt.plusDays(30); dt.plusMonths(1); System.out.print(dt.format(DateTimeFormatter.ISO_DATE)); }
upvoted 3 times
...
UAK94
2 years, 3 months ago
Answer is C. Because dt is immutable. There is no assignment to dt.
upvoted 1 times
...
iSnover
2 years, 3 months ago
Selected Answer: A
The correct answer is the letter A, I'll explain why, the code would compile but notice that the last line doesn't have a "." to invoke the "format" method, then the code would not compile, but as it doesn't have the correct answer, I would mark the answer that most closely matches the reality of this code which is an exception, because in it the code doesn't run either.
upvoted 2 times
...
ivaJava
3 years, 2 months ago
Seriously?? error: incompatible types: LocalDateTime cannot be converted to LocalDate LocalDate time = LocalDateTime.of(2021,12,23,12,15);
upvoted 1 times
...
DanielLeeee
3 years, 3 months ago
answer is C: 2014-07-31
upvoted 2 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