Question 141 · 200 in bank
Given the code fragment:
What is the result?
Show answer
Answer: D
Explanation
Answer is D. Source code throws "Exception in thread "main" java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: HourOfDay" To test: Remember: import java.time.LocalDate; import java.time.format.DateTimeFormatter; public static void main(String[] args) { String date = LocalDate .parse("2014-05-04") .format(DateTimeFormatter.ISO_DATE_TIME); System.out.println(date); }
Source: Adapted from community discussion — carloswork