Given the code fragment: What is the result?
A.
May 04, 2014T00:00:00.000
B.
An exception is thrown at runtime.
C.
2014-05-04T00:00: 00. 000
D.
5/4/14T00:00:00.000
Given the code fragment: What is the result?
A.
May 04, 2014T00:00:00.000
B.
An exception is thrown at runtime.
C.
2014-05-04T00:00: 00. 000
D.
5/4/14T00:00:00.000
I think the correct answer is
B. An exception is thrown at runtime.
why
Correct Answer: B
Exception in thread “main” java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: HourOfDay
Run the code and the answer is B. An exception is thrown at runtime. But what’s the fix or what’s the problem? Is it because an unspecified date object is stored in a string.
So, the real problem is not related with the object stored in the attribute String, but with LocalDate class it have no support to HourOfDay like exception printed. To correct use LocalDateTime or modify formatter to ISO_DATE.
[]’s
Agree with Marcos.
Yes agree with Marcos and several other date formatters also work, such as ISO_LOCAL_DATE. However TestKing says the correct answer is: 2015-05-04T00:00: 00.000. TestKing is wrong again.
Answer: B
output:
Exception in thread “main” java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: HourOfDay
b
Did exam MAY 17, 2017…This question was seen
Answer: B
Answer:B.An exception is thrown at runtime.
Am now OCA Certified as of today. Oh and this question was one the exam
what about the other questions? where they on the exam
La correcta es la B