Given the code fragment:
What is the result?
A. May 04, 2014T00:00:00.000
B. 2014-05-04T00:00: 00. 000
C. 5/4/14T00:00:00.000
D. An exception is thrown at runtime.
Given the code fragment:
What is the result?
A. May 04, 2014T00:00:00.000
B. 2014-05-04T00:00: 00. 000
C. 5/4/14T00:00:00.000
D. An exception is thrown at runtime.
The correct answer is D.
The problem is with format() method. If the parameter and function call was changed to:
.format(DateTimeFormatter.ISO_DATE);
The output would be:
2014-05-04
D is correct !!!